|
|
@ -136,6 +136,7 @@ def upgrade_history():
|
|
|
|
for row in data:
|
|
|
|
for row in data:
|
|
|
|
if row[1] is None:
|
|
|
|
if row[1] is None:
|
|
|
|
path = c.execute('SELECT path FROM table_episodes WHERE sonarrEpisodeId = ?', (row[0],)).fetchone()
|
|
|
|
path = c.execute('SELECT path FROM table_episodes WHERE sonarrEpisodeId = ?', (row[0],)).fetchone()
|
|
|
|
|
|
|
|
if path is not None:
|
|
|
|
c.execute('UPDATE table_history SET video_path = ? WHERE sonarrEpisodeId = ?', (path[0], row[0]))
|
|
|
|
c.execute('UPDATE table_history SET video_path = ? WHERE sonarrEpisodeId = ?', (path[0], row[0]))
|
|
|
|
|
|
|
|
|
|
|
|
values = re.split(r' subtitles downloaded from | with a score of | using', row[2])[:-1]
|
|
|
|
values = re.split(r' subtitles downloaded from | with a score of | using', row[2])[:-1]
|
|
|
@ -151,12 +152,12 @@ def upgrade_history_movies():
|
|
|
|
db = sqlite3.connect(os.path.join(args.config_dir, 'db', 'bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(args.config_dir, 'db', 'bazarr.db'), timeout=30)
|
|
|
|
c = db.cursor()
|
|
|
|
c = db.cursor()
|
|
|
|
|
|
|
|
|
|
|
|
data = c.execute(
|
|
|
|
data = c.execute('SELECT radarrId, video_path, description, ROWID FROM table_history_movie WHERE action = 1').fetchall()
|
|
|
|
'SELECT radarrId, video_path, description, ROWID FROM table_history_movie WHERE action = 1').fetchall()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for row in data:
|
|
|
|
for row in data:
|
|
|
|
if row[1] is None:
|
|
|
|
if row[1] is None:
|
|
|
|
path = c.execute('SELECT path FROM table_movies WHERE radarrId = ?', (row[0],)).fetchone()
|
|
|
|
path = c.execute('SELECT path FROM table_movies WHERE radarrId = ?', (row[0],)).fetchone()
|
|
|
|
|
|
|
|
if path is not None:
|
|
|
|
c.execute('UPDATE table_history_movie SET video_path = ? WHERE radarrId = ?', (path[0], row[0]))
|
|
|
|
c.execute('UPDATE table_history_movie SET video_path = ? WHERE radarrId = ?', (path[0], row[0]))
|
|
|
|
|
|
|
|
|
|
|
|
values = re.split(r' subtitles downloaded from | with a score of | using', row[2])[:-1]
|
|
|
|
values = re.split(r' subtitles downloaded from | with a score of | using', row[2])[:-1]
|
|
|
|