Update subgen.py
This commit is contained in:
@@ -780,13 +780,16 @@ def get_jellyfin_admin(users):
|
|||||||
|
|
||||||
def has_audio(file_path):
|
def has_audio(file_path):
|
||||||
try:
|
try:
|
||||||
with av.open(file_path) as container:
|
|
||||||
if has_image_extension(file_path):
|
if has_image_extension(file_path):
|
||||||
|
logging.debug("{file_path} is an image, skipping processing")
|
||||||
return False
|
return False
|
||||||
|
with av.open(file_path) as container:
|
||||||
return any(stream.type == 'audio' for stream in container.streams)
|
return any(stream.type == 'audio' for stream in container.streams)
|
||||||
except (av.AVError, UnicodeDecodeError):
|
except (av.AVError, UnicodeDecodeError):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def path_mapping(fullpath):
|
def path_mapping(fullpath):
|
||||||
if use_path_mapping:
|
if use_path_mapping:
|
||||||
logging.debug("Updated path: " + fullpath.replace(path_mapping_from, path_mapping_to))
|
logging.debug("Updated path: " + fullpath.replace(path_mapping_from, path_mapping_to))
|
||||||
|
|||||||
Reference in New Issue
Block a user