This commit is contained in:
Jesse Bannon 2023-07-24 10:55:21 -07:00
parent b68fba2825
commit b9ad72430d
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,4 @@
from typing import List
from typing import Optional from typing import Optional
import mediafile import mediafile
@ -43,7 +44,7 @@ class EmbedThumbnailPlugin(Plugin[EmbedThumbnailOptions]):
thumbnail_path = entry.get_download_thumbnail_path() thumbnail_path = entry.get_download_thumbnail_path()
tmp_file_path = FFMPEG.tmp_file_path(file_path) tmp_file_path = FFMPEG.tmp_file_path(file_path)
try: try:
cmd = [ ffmpeg_args: List[str] = [
"-i", "-i",
file_path, file_path,
"-i", "-i",
@ -60,7 +61,7 @@ class EmbedThumbnailPlugin(Plugin[EmbedThumbnailOptions]):
"attached_pic", "attached_pic",
tmp_file_path, tmp_file_path,
] ]
FFMPEG.run(cmd) FFMPEG.run(ffmpeg_args)
FileHandler.move(tmp_file_path, file_path) FileHandler.move(tmp_file_path, file_path)
finally: finally:
FileHandler.delete(tmp_file_path) FileHandler.delete(tmp_file_path)

View file

@ -51,6 +51,10 @@ class TestConfigFilePartiallyValidatesPresets:
@pytest.mark.parametrize("plugin", PluginMapping.plugins()) @pytest.mark.parametrize("plugin", PluginMapping.plugins())
def test_success__empty_plugins(self, plugin: str): def test_success__empty_plugins(self, plugin: str):
excluded_plugins = [
"embed_thumbnail", # value is bool, not dict
]
if plugin not in excluded_plugins:
self._partial_validate({plugin: {}}) self._partial_validate({plugin: {}})
@pytest.mark.parametrize("source", DownloadStrategyMapping.sources()) @pytest.mark.parametrize("source", DownloadStrategyMapping.sources())