From 9c9e447cc77a0aa53b9caa6eee96b298a2204b59 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:05:35 -0600 Subject: [PATCH] Update subgen.py --- subgen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subgen.py b/subgen.py index e76ae64..aea88f4 100644 --- a/subgen.py +++ b/subgen.py @@ -780,13 +780,16 @@ def get_jellyfin_admin(users): def has_audio(file_path): try: + if has_image_extension(file_path): + logging.debug("{file_path} is an image, skipping processing") + return False with av.open(file_path) as container: - if has_image_extension(file_path): - return False return any(stream.type == 'audio' for stream in container.streams) except (av.AVError, UnicodeDecodeError): return False + + def path_mapping(fullpath): if use_path_mapping: logging.debug("Updated path: " + fullpath.replace(path_mapping_from, path_mapping_to))