Fix handling of unrecognized mimetypes in Synology DSM photos integration (#104848)

This commit is contained in:
Michael 2023-12-01 15:58:15 +01:00 committed by Franck Nijhof
parent d67d2d9566
commit 074bcc8adc
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -153,8 +153,7 @@ class SynologyPhotosMediaSource(MediaSource):
ret = [] ret = []
for album_item in album_items: for album_item in album_items:
mime_type, _ = mimetypes.guess_type(album_item.file_name) mime_type, _ = mimetypes.guess_type(album_item.file_name)
assert isinstance(mime_type, str) if isinstance(mime_type, str) and mime_type.startswith("image/"):
if mime_type.startswith("image/"):
# Force small small thumbnails # Force small small thumbnails
album_item.thumbnail_size = "sm" album_item.thumbnail_size = "sm"
ret.append( ret.append(