From eb500e0f17f940b9ff88745053d8753e96f3d9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 21 Nov 2017 19:50:06 -0500 Subject: [PATCH] Test --- list_subtitles.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/list_subtitles.py b/list_subtitles.py index 5d52861bb..35c4e8f7b 100644 --- a/list_subtitles.py +++ b/list_subtitles.py @@ -52,18 +52,17 @@ def store_subtitles(file): except: pass - conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) - c_db = conn_db.cursor() - subtitles = core.search_external_subtitles(file) for subtitle, language in subtitles.iteritems(): actual_subtitles.append([str(language), path_replace_reverse(os.path.join(os.path.dirname(file), subtitle))]) - try: - c_db.execute("UPDATE table_episodes SET subtitles = ? WHERE path = ?", (str(actual_subtitles), path_replace_reverse(file))) - conn_db.commit() - except: - pass + + conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) + c_db = conn_db.cursor() + + c_db.execute("UPDATE table_episodes SET subtitles = ? WHERE path = ?", (str(actual_subtitles), path_replace_reverse(file))) + conn_db.commit() + c_db.close() return actual_subtitles