From 6619c66b73b9211ce44d36e6a11ca85c7cda9d14 Mon Sep 17 00:00:00 2001 From: Audionut Date: Sat, 14 Dec 2024 09:32:23 +1000 Subject: [PATCH] Handle lack of mi.json --- src/prep.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/prep.py b/src/prep.py index 83d165fa..c7ad44b3 100644 --- a/src/prep.py +++ b/src/prep.py @@ -2512,8 +2512,12 @@ def get_tag(self, video, meta): return tag def get_source(self, type, video, path, is_disc, meta, folder_id, base_dir): - with open(f'{base_dir}/tmp/{folder_id}/MediaInfo.json', 'r', encoding='utf-8') as f: - mi = json.load(f) + try: + with open(f'{base_dir}/tmp/{folder_id}/MediaInfo.json', 'r', encoding='utf-8') as f: + mi = json.load(f) + except Exception: + if meta['debug']: + console.print("No mediainfo.json") resolution = meta['resolution'] try: try: