weebzone commited on
Commit ·
746c953
1
Parent(s): 084d77d
try
Browse files
Backend/helper/metadata.py
CHANGED
|
@@ -340,8 +340,10 @@ async def fetch_movie_metadata(title, encoded_string, year=None, quality=None, d
|
|
| 340 |
use_tmdb = False
|
| 341 |
|
| 342 |
if default_id:
|
|
|
|
| 343 |
if str(default_id).startswith("tt"):
|
| 344 |
imdb_id = default_id
|
|
|
|
| 345 |
elif str(default_id).isdigit():
|
| 346 |
tmdb_id = int(default_id)
|
| 347 |
use_tmdb = True
|
|
@@ -353,12 +355,14 @@ async def fetch_movie_metadata(title, encoded_string, year=None, quality=None, d
|
|
| 353 |
movie_details = None
|
| 354 |
|
| 355 |
if imdb_id and not use_tmdb:
|
|
|
|
| 356 |
try:
|
| 357 |
if imdb_id in IMDB_CACHE:
|
| 358 |
movie_details = IMDB_CACHE[imdb_id]
|
| 359 |
else:
|
| 360 |
async with API_SEMAPHORE:
|
| 361 |
movie_details = await get_detail(imdb_id=imdb_id, media_type="movie")
|
|
|
|
| 362 |
IMDB_CACHE[imdb_id] = movie_details
|
| 363 |
except Exception as e:
|
| 364 |
LOGGER.warning(f"IMDb movie fetch failed [{title}]: {e}")
|
|
|
|
| 340 |
use_tmdb = False
|
| 341 |
|
| 342 |
if default_id:
|
| 343 |
+
LOGGER.info(default_id)
|
| 344 |
if str(default_id).startswith("tt"):
|
| 345 |
imdb_id = default_id
|
| 346 |
+
LOGGER.info(imdb_id)
|
| 347 |
elif str(default_id).isdigit():
|
| 348 |
tmdb_id = int(default_id)
|
| 349 |
use_tmdb = True
|
|
|
|
| 355 |
movie_details = None
|
| 356 |
|
| 357 |
if imdb_id and not use_tmdb:
|
| 358 |
+
|
| 359 |
try:
|
| 360 |
if imdb_id in IMDB_CACHE:
|
| 361 |
movie_details = IMDB_CACHE[imdb_id]
|
| 362 |
else:
|
| 363 |
async with API_SEMAPHORE:
|
| 364 |
movie_details = await get_detail(imdb_id=imdb_id, media_type="movie")
|
| 365 |
+
LOGGER.info(movie_details)
|
| 366 |
IMDB_CACHE[imdb_id] = movie_details
|
| 367 |
except Exception as e:
|
| 368 |
LOGGER.warning(f"IMDb movie fetch failed [{title}]: {e}")
|