1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2025-01-31 11:22:38 +00:00
This commit is contained in:
Louis Vézina 2017-11-21 19:50:06 -05:00
parent 9cd5a5d304
commit eb500e0f17

View file

@ -52,18 +52,17 @@ def store_subtitles(file):
except: except:
pass 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) subtitles = core.search_external_subtitles(file)
for subtitle, language in subtitles.iteritems(): for subtitle, language in subtitles.iteritems():
actual_subtitles.append([str(language), path_replace_reverse(os.path.join(os.path.dirname(file), subtitle))]) 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 = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
conn_db.commit() c_db = conn_db.cursor()
except:
pass c_db.execute("UPDATE table_episodes SET subtitles = ? WHERE path = ?", (str(actual_subtitles), path_replace_reverse(file)))
conn_db.commit()
c_db.close() c_db.close()
return actual_subtitles return actual_subtitles