case-insensitive image formats

Sometimes the image format comes as `image/JPEG`, which results in an `Unsupported image format: image/JPEG`
This commit is contained in:
Artur Y
2024-12-06 15:33:22 +01:00
committed by GitHub
parent 804b2bfe7e
commit a20f1733f1

View File

@@ -367,7 +367,7 @@ class JellyfinClient:
raise Exception(f"Failed to download image from Spotify: {response.content}")
# Step 2: Check the image content type (assume it's JPEG or PNG based on the content type from the response)
content_type = response.headers.get('Content-Type')
content_type = response.headers.get('Content-Type').lower()
if content_type not in ['image/jpeg', 'image/png', 'application/octet-stream']:
raise Exception(f"Unsupported image format: {content_type}")
# Todo: