[scrolller] fix exception for albums with missing media (#7428)

fixes regression introduced in a44ea6b3d9
This commit is contained in:
Mike Fährmann
2025-04-27 08:56:44 +02:00
parent 87f02acd9e
commit d7c365e08c
3 changed files with 19 additions and 2 deletions

View File

@@ -56,7 +56,12 @@ class ScrolllerExtractor(Extractor):
files = []
for num, media in enumerate(album, 1):
src = max(media["mediaSources"], key=self._sort_key)
sources = media.get("mediaSources")
if not sources:
self.log.warning("%s/%s: Missing media file",
post.get("id"), num)
continue
src = max(sources, key=self._sort_key)
src["num"] = num
files.append(src)
return files

View File

@@ -6,5 +6,5 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.29.5"
__version__ = "1.29.6-dev"
__variant__ = None