aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/embedthumbnail.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/postprocessor/embedthumbnail.py')
-rw-r--r--yt_dlp/postprocessor/embedthumbnail.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py
index 207be776e..d36e0008e 100644
--- a/yt_dlp/postprocessor/embedthumbnail.py
+++ b/yt_dlp/postprocessor/embedthumbnail.py
@@ -220,11 +220,9 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
os.replace(temp_filename, filename)
self.try_utime(filename, mtime, mtime)
-
- files_to_delete = [thumbnail_filename]
- if self._already_have_thumbnail:
- if original_thumbnail == thumbnail_filename:
- files_to_delete = []
- elif original_thumbnail != thumbnail_filename:
- files_to_delete.append(original_thumbnail)
- return files_to_delete, info
+ converted = original_thumbnail != thumbnail_filename
+ self._delete_downloaded_files(
+ thumbnail_filename if converted or not self._already_have_thumbnail else None,
+ original_thumbnail if converted and not self._already_have_thumbnail else None,
+ info=info)
+ return [], info