From 46af20912bee39a8d1a100aa5236ddf94bd0bf80 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 6 Feb 2021 15:10:52 +0100 Subject: [PATCH] Fix update_renumber_options --- core/videolibrarytools.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 835d60b2..69f27f3c 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -235,14 +235,14 @@ def update_renumber_options(item, head_nfo, path): if filetools.isfile(tvshow_path) and item.channel_prefs: for channel in item.channel_prefs: filename = filetools.join(config.get_data_path(), "settings_channels", channel + '_data.json') - - json_file = jsontools.load(filetools.read(filename)) - if RENUMBER in json_file: - json = json_file[RENUMBER] - if item.fulltitle in json: - item.channel_prefs[channel][RENUMBER] = json[item.fulltitle] - logger.debug('UPDATED=\n' + str(item.channel_prefs)) - filetools.write(tvshow_path, head_nfo + item.tojson()) + if filetools.isfile(filename): + json_file = jsontools.load(filetools.read(filename)) + if RENUMBER in json_file: + json = json_file[RENUMBER] + if item.fulltitle in json: + item.channel_prefs[channel][RENUMBER] = json[item.fulltitle] + logger.debug('UPDATED=\n' + str(item.channel_prefs)) + filetools.write(tvshow_path, head_nfo + item.tojson()) def add_renumber_options(item, head_nfo, path): from core import jsontools