Added check for file existence before trying to analyze it

This prevents a horrible, multiline, stack trace message from knowit and replaces it with a single clear log message.
This commit is contained in:
JayZed 2024-01-14 12:17:24 -05:00
parent b90834edae
commit e9db688e22
1 changed files with 5 additions and 0 deletions

View File

@ -266,6 +266,11 @@ def parse_video_metadata(file, file_size, episode_file_id=None, movie_file_id=No
elif embedded_subs_parser == 'mediainfo':
mediainfo_path = get_binary("mediainfo")
# see if file exists (perhaps offline)
if not os.path.exists(file):
logging.error(f'Video file "{file}" cannot be found for analysis')
return None
# if we have ffprobe available
if ffprobe_path:
try: