From 75a90596369640495c24b238cc2bef60b9e7fd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 4 Nov 2017 21:20:27 -0400 Subject: [PATCH] Bug correction --- list_subtitles.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/list_subtitles.py b/list_subtitles.py index 1b89d1e0c..9c24b5353 100644 --- a/list_subtitles.py +++ b/list_subtitles.py @@ -85,9 +85,12 @@ def list_missing_subtitles(*no): actual_subtitles = ast.literal_eval(episode_subtitles[1]) desired_subtitles = ast.literal_eval(episode_subtitles[2]) actual_subtitles_list = [] - for item in actual_subtitles: - actual_subtitles_list.append(item[0]) - missing_subtitles = list(set(desired_subtitles) - set(actual_subtitles_list)) + if desired_subtitles == None: + missing_subtitles_global.append(tuple(['[]', episode_subtitles[0]])) + else: + for item in actual_subtitles: + actual_subtitles_list.append(item[0]) + missing_subtitles = list(set(desired_subtitles) - set(actual_subtitles_list)) missing_subtitles_global.append(tuple([str(missing_subtitles), episode_subtitles[0]])) c_db.executemany("UPDATE table_episodes SET missing_subtitles = ? WHERE sonarrEpisodeId = ?", (missing_subtitles_global))