Fix spotify podcast thumb image quality (#2885)
authorOzGav <gavnosp@hotmail.com>
Mon, 29 Dec 2025 09:57:20 +0000 (19:57 +1000)
committerGitHub <noreply@github.com>
Mon, 29 Dec 2025 09:57:20 +0000 (10:57 +0100)
* Fix Spotify podcast thumbnail image quality

* Remove debug line

* Simplify

music_assistant/providers/spotify/parsers.py

index 557bde948978f19a4f075dfc1467f9b37bc76e7d..e41b47a287cf00819753ec77abf830adf928743a 100644 (file)
@@ -45,9 +45,11 @@ def parse_images(
     if not filtered_images:
         return UniqueList([])
 
-    # Spotify orders images from largest to smallest (640x640, 300x300, 64x64)
-    # Select the largest (highest quality) image - the first one
-    best_image = filtered_images[0]
+    # Spotify images come in various sizes (typically 640x640, 300x300, 64x64)
+    # Find the largest image available
+    best_image = max(
+        filtered_images, key=lambda img: img.get("height", 0), default=filtered_images[0]
+    )
 
     return UniqueList(
         [