1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 09:37:25 +00:00

Continuing development.

This commit is contained in:
Louis Vézina 2019-08-21 09:30:00 -04:00
parent a985f43178
commit e9864febc1

View file

@ -4,6 +4,7 @@ import os
import requests
import logging
from queueconfig import notifications
from collections import OrderedDict
import datetime
from get_args import args
@ -76,17 +77,17 @@ def update_series():
current_shows_sonarr.append(show['tvdbId'])
if show['tvdbId'] in current_shows_db_list:
series_to_update.append({'title': show["title"],
'path': show["path"],
'tvdb_id': show["tvdbId"],
'sonarr_series_id': show["id"],
'overview': overview,
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language((show['qualityProfileId'] if sonarr_version == 2 else show['languageProfileId'])),
'sort_title': show['sortTitle'],
'year': show['year'],
'alternate_titles': alternateTitles})
series_to_update.append({'title': unicode(show["title"]),
'path': unicode(show["path"]),
'tvdb_id': int(show["tvdbId"]),
'sonarr_series_id': int(show["id"]),
'overview': unicode(overview),
'poster': unicode(poster),
'fanart': unicode(fanart),
'audio_language': unicode(profile_id_to_language((show['qualityProfileId'] if sonarr_version == 2 else show['languageProfileId']))),
'sort_title': unicode(show['sortTitle']),
'year': unicode(show['year']),
'alternate_titles': unicode(alternateTitles)})
else:
if serie_default_enabled is True:
series_to_add.append({'title': show["title"],
@ -135,7 +136,6 @@ def update_series():
for item in series_in_db:
series_in_db_list.append(item)
# Group episodes by seasons
series_to_update_list = [i for i in series_to_update if i not in series_in_db_list]
for updated_series in series_to_update_list:
@ -152,7 +152,7 @@ def update_series():
).on_conflict_ignore().execute()
list_missing_subtitles(added_series['sonarr_series_id'])
# Remove old episodes from DB
# Remove old series from DB
removed_series = list(set(current_shows_db_list) - set(current_shows_sonarr))
for series in removed_series: