Update subgen.py

This commit is contained in:
McCloudS
2024-08-12 14:05:35 -06:00
committed by GitHub
parent 9c4956a559
commit 9c9e447cc7

View File

@@ -780,13 +780,16 @@ def get_jellyfin_admin(users):
def has_audio(file_path):
try:
with av.open(file_path) as container:
if has_image_extension(file_path):
logging.debug("{file_path} is an image, skipping processing")
return False
with av.open(file_path) as container:
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))