|
|
|
@ -128,7 +128,7 @@ def update_series():
|
|
|
|
|
|
|
|
|
|
for series in removed_series:
|
|
|
|
|
database.execute("DELETE FROM table_shows WHERE sonarrSeriesId=?",(series,))
|
|
|
|
|
event_stream.write(type='series', action='delete', series=series)
|
|
|
|
|
event_stream.write(type='series', action='delete', series=series)
|
|
|
|
|
|
|
|
|
|
# Update existing series in DB
|
|
|
|
|
series_in_db_list = []
|
|
|
|
@ -144,7 +144,7 @@ def update_series():
|
|
|
|
|
query = dict_converter.convert(updated_series)
|
|
|
|
|
database.execute('''UPDATE table_shows SET ''' + query.keys_update + ''' WHERE sonarrSeriesId = ?''',
|
|
|
|
|
query.values + (updated_series['sonarrSeriesId'],))
|
|
|
|
|
event_stream.write(type='series', action='update', series=updated_series['sonarrSeriesId'])
|
|
|
|
|
event_stream.write(type='series', action='update', series=updated_series['sonarrSeriesId'])
|
|
|
|
|
|
|
|
|
|
# Insert new series in DB
|
|
|
|
|
for added_series in series_to_add:
|
|
|
|
@ -158,7 +158,7 @@ def update_series():
|
|
|
|
|
logging.debug('BAZARR unable to insert this series into the database:',
|
|
|
|
|
path_replace(added_series['path']))
|
|
|
|
|
|
|
|
|
|
event_stream.write(type='series', action='insert', series=added_series['sonarrSeriesId'])
|
|
|
|
|
event_stream.write(type='series', action='insert', series=added_series['sonarrSeriesId'])
|
|
|
|
|
|
|
|
|
|
logging.debug('BAZARR All series synced from Sonarr into database.')
|
|
|
|
|
|
|
|
|
|