Don't change sort function

This commit is contained in:
7x11x13
2024-12-24 12:38:25 -05:00
parent afe35b43fa
commit 1bfc5b5927
2 changed files with 21 additions and 10 deletions
+4 -1
View File
@@ -62,7 +62,10 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
self.to_screen('There aren\'t any thumbnails to embed')
return [], info
idx = next((-i for i, t in enumerate(info['thumbnails'][::-1], 1) if t.get('filepath')), None)
if self._downloader and (fmt := self._downloader.params.get('thumbnail_format')):
idx = next((i for i, t in enumerate(info['thumbnails']) if t.get('id') == fmt and t.get('filepath')), None)
else:
idx = next((-i for i, t in enumerate(info['thumbnails'][::-1], 1) if t.get('filepath')), None)
if idx is None:
self.to_screen('There are no thumbnails on disk')
return [], info