[embedthumbnail] Correctly escape filename

Closes #352
The approach in [1] is faulty as can be seen in the test cases
1. bff857a8af
This commit is contained in:
pukkandan
2021-05-29 01:39:07 +05:30
parent 885cc0b75c
commit 337e0c62f8
5 changed files with 75 additions and 56 deletions

View File

@@ -70,7 +70,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
self.to_screen('There aren\'t any thumbnails to embed')
return [], info
idx = next((-(i+1) for i, t in enumerate(info['thumbnails'][::-1]) if t.get('filepath')), None)
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