new check for edge case

This commit is contained in:
msramalho
2025-06-17 20:36:22 +01:00
parent 2aec240128
commit 23b781c866
2 changed files with 4 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ class ThumbnailEnricher(Enricher):
).run() ).run()
try: try:
if not os.path.exists(output_path):
logger.info(f"thumbnail {index} for media {m.filename} was not created")
continue
thumbnails_media.append( thumbnails_media.append(
Media(filename=output_path) Media(filename=output_path)
.set("id", f"thumbnail_{index}") .set("id", f"thumbnail_{index}")

View File

@@ -25,6 +25,7 @@ def mock_ffmpeg_environment(mocker):
# Mocking all the ffmpeg calls in one place # Mocking all the ffmpeg calls in one place
mock_ffmpeg_input = mocker.patch("ffmpeg.input") mock_ffmpeg_input = mocker.patch("ffmpeg.input")
mock_makedirs = mocker.patch("os.makedirs") mock_makedirs = mocker.patch("os.makedirs")
mocker.patch("os.path.exists", return_value=True)
(mocker.patch.object(Media, "is_video", return_value=True),) (mocker.patch.object(Media, "is_video", return_value=True),)
mock_probe = mocker.patch( mock_probe = mocker.patch(
"ffmpeg.probe", "ffmpeg.probe",