From 196f5678dffecace9a85c2981c88481cfe1aa231 Mon Sep 17 00:00:00 2001 From: Felipe Marinho Date: Wed, 13 Nov 2024 18:04:39 -0300 Subject: [PATCH] chg: add debug log --- scanner/providers/implementations/themoviedatabase.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scanner/providers/implementations/themoviedatabase.py b/scanner/providers/implementations/themoviedatabase.py index f39d3b33..dc09394c 100644 --- a/scanner/providers/implementations/themoviedatabase.py +++ b/scanner/providers/implementations/themoviedatabase.py @@ -149,6 +149,8 @@ class TheMovieDatabase(Provider): Returns: list: A list of images, prioritized by localization, original language, and any available image. """ + print(f"Trying to get best image for {item['title']} in {lng}") + print(f"All available languageCodes: {list(map(lambda x: x['iso_639_1'], item['images'][key]))}") # Order images by size and vote average item["images"][key] = sorted( item["images"][key], @@ -163,8 +165,11 @@ class TheMovieDatabase(Provider): if image.get("iso_639_1") == lng ] + print(f"Localized images: {localized_images}") + # Step 2: If no localized images, try images in the original language if not localized_images: + print(f"Could not find localized images for {lng}, trying original language") localized_images = [ image for image in item["images"][key] @@ -173,6 +178,7 @@ class TheMovieDatabase(Provider): # Step 3: If still no images, use any available images if not localized_images: + print(f"Could not find images for {lng} or original language, using any available") localized_images = item["images"][key] return localized_images