Merge branch 'development' into hermes

pull/884/head
Louis Vézina 5 years ago
commit 25a4126f6d

@ -22,6 +22,8 @@ def update_all_movies():
def update_movies():
logging.debug('BAZARR Starting movie sync from Radarr.')
apikey_radarr = settings.radarr.apikey
radarr_version = get_radarr_version()
movie_default_enabled = settings.general.getboolean('movie_default_enabled')
movie_default_language = settings.general.movie_default_language
movie_default_hi = settings.general.movie_default_hi
@ -127,6 +129,8 @@ def update_movies():
videoCodec = None
audioCodec = None
audio_language = profile_id_to_language(movie['qualityProfileId'], audio_profiles)
# Add movies in radarr to current movies list
current_movies_radarr.append(str(movie['tmdbId']))
@ -137,7 +141,7 @@ def update_movies():
'tmdbId': str(movie["tmdbId"]),
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': str(bool(movie['monitored'])),
'year': str(movie['year']),
@ -162,7 +166,7 @@ def update_movies():
'overview': overview,
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': str(bool(movie['monitored'])),
'sortTitle': movie['sortTitle'],
@ -186,7 +190,7 @@ def update_movies():
'overview': overview,
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': str(bool(movie['monitored'])),
'sortTitle': movie['sortTitle'],
@ -272,8 +276,11 @@ def get_profile_list():
radarr_version = get_radarr_version()
profiles_list = []
# Get profiles data from radarr
if radarr_version.startswith('0'):
url_radarr_api_movies = url_radarr() + "/api/profile?apikey=" + apikey_radarr
else:
url_radarr_api_movies = url_radarr() + "/api/v3/qualityprofile?apikey=" + apikey_radarr
try:
profiles_json = requests.get(url_radarr_api_movies, timeout=60, verify=False)
except requests.exceptions.ConnectionError as errc:
@ -287,7 +294,7 @@ def get_profile_list():
if radarr_version.startswith('0'):
for profile in profiles_json.json():
profiles_list.append([profile['id'], profile['language'].capitalize()])
elif radarr_version.startswith('2'):
else:
for profile in profiles_json.json():
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])

@ -234,7 +234,7 @@ class BSPlayerProvider(Provider):
def get_sub_domain(self):
# s1-9, s101-109
SUB_DOMAINS = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9',
SUB_DOMAINS = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8',
's101', 's102', 's103', 's104', 's105', 's106', 's107', 's108', 's109']
API_URL_TEMPLATE = "http://{sub_domain}.api.bsplayer-subtitles.com/v1.php"
sub_domains_end = len(SUB_DOMAINS) - 1

Loading…
Cancel
Save