Karan Adhikari commited on
metadata patch
Browse files
Backend/helper/metadata.py
CHANGED
|
@@ -333,7 +333,7 @@ async def fetch_tv_metadata(title, season, episode, encoded_string, year=None, q
|
|
| 333 |
"genres": [g.name for g in (tv.genres or [])],
|
| 334 |
"media_type": "tv",
|
| 335 |
"cast": cast,
|
| 336 |
-
"runtime": runtime,
|
| 337 |
|
| 338 |
"season_number": season,
|
| 339 |
"episode_number": episode,
|
|
@@ -359,7 +359,7 @@ async def fetch_tv_metadata(title, season, episode, encoded_string, year=None, q
|
|
| 359 |
images = format_imdb_images(imdb_id)
|
| 360 |
|
| 361 |
return {
|
| 362 |
-
"tmdb_id": imdb.get("moviedb_id"),
|
| 363 |
"imdb_id": imdb_id,
|
| 364 |
"title": imdb.get("title", title),
|
| 365 |
"year": imdb.get("releaseDetailed", {}).get("year", 0),
|
|
@@ -369,7 +369,7 @@ async def fetch_tv_metadata(title, season, episode, encoded_string, year=None, q
|
|
| 369 |
"backdrop": images["backdrop"],
|
| 370 |
"logo": images["logo"],
|
| 371 |
"cast": imdb.get("cast", []),
|
| 372 |
-
"runtime": imdb.get("runtime"
|
| 373 |
"genres": imdb.get("genre", []),
|
| 374 |
"media_type": "tv",
|
| 375 |
|
|
@@ -487,7 +487,7 @@ async def fetch_movie_metadata(title, encoded_string, year=None, quality=None, d
|
|
| 487 |
"backdrop": format_tmdb_image(movie.backdrop_path, "original"),
|
| 488 |
"logo": get_tmdb_logo(getattr(movie, "images", None)),
|
| 489 |
"cast": cast_names,
|
| 490 |
-
"runtime": runtime,
|
| 491 |
"media_type": "movie",
|
| 492 |
"genres": [g.name for g in (movie.genres or [])],
|
| 493 |
"quality": quality,
|
|
@@ -501,7 +501,7 @@ async def fetch_movie_metadata(title, encoded_string, year=None, quality=None, d
|
|
| 501 |
imdb = imdb_details or {}
|
| 502 |
|
| 503 |
return {
|
| 504 |
-
"tmdb_id": imdb.get("moviedb_id") or
|
| 505 |
"imdb_id": imdb_id,
|
| 506 |
"title": imdb.get("title", title),
|
| 507 |
"year": imdb.get("releaseDetailed", {}).get("year", 0),
|
|
@@ -511,7 +511,7 @@ async def fetch_movie_metadata(title, encoded_string, year=None, quality=None, d
|
|
| 511 |
"backdrop": images["backdrop"],
|
| 512 |
"logo": images["logo"],
|
| 513 |
"cast": imdb.get("cast", []),
|
| 514 |
-
"runtime": imdb.get("runtime"
|
| 515 |
"media_type": "movie",
|
| 516 |
"genres": imdb.get("genre", []),
|
| 517 |
"quality": quality,
|
|
|
|
| 333 |
"genres": [g.name for g in (tv.genres or [])],
|
| 334 |
"media_type": "tv",
|
| 335 |
"cast": cast,
|
| 336 |
+
"runtime": str(runtime),
|
| 337 |
|
| 338 |
"season_number": season,
|
| 339 |
"episode_number": episode,
|
|
|
|
| 359 |
images = format_imdb_images(imdb_id)
|
| 360 |
|
| 361 |
return {
|
| 362 |
+
"tmdb_id": imdb.get("moviedb_id") or imdb_id.replace("tt", ""),
|
| 363 |
"imdb_id": imdb_id,
|
| 364 |
"title": imdb.get("title", title),
|
| 365 |
"year": imdb.get("releaseDetailed", {}).get("year", 0),
|
|
|
|
| 369 |
"backdrop": images["backdrop"],
|
| 370 |
"logo": images["logo"],
|
| 371 |
"cast": imdb.get("cast", []),
|
| 372 |
+
"runtime": str(imdb.get("runtime") or ""),
|
| 373 |
"genres": imdb.get("genre", []),
|
| 374 |
"media_type": "tv",
|
| 375 |
|
|
|
|
| 487 |
"backdrop": format_tmdb_image(movie.backdrop_path, "original"),
|
| 488 |
"logo": get_tmdb_logo(getattr(movie, "images", None)),
|
| 489 |
"cast": cast_names,
|
| 490 |
+
"runtime": str(runtime),
|
| 491 |
"media_type": "movie",
|
| 492 |
"genres": [g.name for g in (movie.genres or [])],
|
| 493 |
"quality": quality,
|
|
|
|
| 501 |
imdb = imdb_details or {}
|
| 502 |
|
| 503 |
return {
|
| 504 |
+
"tmdb_id": imdb.get("moviedb_id") or imdb_id.replace("tt", ""),
|
| 505 |
"imdb_id": imdb_id,
|
| 506 |
"title": imdb.get("title", title),
|
| 507 |
"year": imdb.get("releaseDetailed", {}).get("year", 0),
|
|
|
|
| 511 |
"backdrop": images["backdrop"],
|
| 512 |
"logo": images["logo"],
|
| 513 |
"cast": imdb.get("cast", []),
|
| 514 |
+
"runtime": str(imdb.get("runtime") or ""),
|
| 515 |
"media_type": "movie",
|
| 516 |
"genres": imdb.get("genre", []),
|
| 517 |
"quality": quality,
|