pull/684/head
Louis Vézina 5 years ago
parent d31299870d
commit d4f67b62fc

@ -1,6 +1,6 @@
# coding=utf-8 # coding=utf-8
from __future__ import absolute_import from __future__ import absolute_import, print_function
import os import os
import time import time
import rarfile import rarfile
@ -35,7 +35,7 @@ if not os.path.exists(args.config_dir):
try: try:
os.mkdir(os.path.join(args.config_dir)) os.mkdir(os.path.join(args.config_dir))
except OSError: except OSError:
print "BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?)." print("BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?).")
exit(2) exit(2)
if not os.path.exists(os.path.join(args.config_dir, 'config')): if not os.path.exists(os.path.join(args.config_dir, 'config')):

@ -15,6 +15,7 @@ from subliminal_patch import search_external_subtitles
from subzero.language import Language from subzero.language import Language
from bs4 import UnicodeDammit from bs4 import UnicodeDammit
from itertools import islice from itertools import islice
import six
from get_args import args from get_args import args
from database import database from database import database
@ -65,7 +66,7 @@ def store_subtitles(original_path, reversed_path):
subliminal_patch.core.CUSTOM_PATHS = [dest_folder] if dest_folder else [] subliminal_patch.core.CUSTOM_PATHS = [dest_folder] if dest_folder else []
subtitles = search_external_subtitles(reversed_path, languages=get_language_set(), subtitles = search_external_subtitles(reversed_path, languages=get_language_set(),
only_one=settings.general.getboolean('single_language')) only_one=settings.general.getboolean('single_language'))
subtitles = guess_external_subtitles(get_subtitle_destination_folder() or os.path.dirname(file), subtitles) subtitles = guess_external_subtitles(get_subtitle_destination_folder() or os.path.dirname(reversed_path), subtitles)
except Exception as e: except Exception as e:
logging.exception("BAZARR unable to index external subtitles.") logging.exception("BAZARR unable to index external subtitles.")
pass pass
@ -395,7 +396,7 @@ def get_external_subtitles_path(file, subtitle):
def guess_external_subtitles(dest_folder, subtitles): def guess_external_subtitles(dest_folder, subtitles):
for subtitle, language in subtitles.iteritems(): for subtitle, language in six.iteritems(subtitles):
if not language: if not language:
subtitle_path = os.path.join(dest_folder, subtitle) subtitle_path = os.path.join(dest_folder, subtitle)
if os.path.exists(subtitle_path) and os.path.splitext(subtitle_path)[1] in core.SUBTITLE_EXTENSIONS: if os.path.exists(subtitle_path) and os.path.splitext(subtitle_path)[1] in core.SUBTITLE_EXTENSIONS:

@ -98,7 +98,7 @@ def get_sonarr_version():
def get_sonarr_platform(): def get_sonarr_platform():
use_sonarr = settings.general.getboolean('use_sonarr') use_sonarr = settings.general.getboolean('use_sonarr')
apikey_sonarr = settings.sonarr.apikey apikey_sonarr = settings.sonarr.apikey
sv = url_sonarr + "/api/system/status?apikey=" + apikey_sonarr sv = url_sonarr() + "/api/system/status?apikey=" + apikey_sonarr
sonarr_platform = '' sonarr_platform = ''
if use_sonarr: if use_sonarr:
try: try:
@ -129,7 +129,7 @@ def get_radarr_version():
def get_radarr_platform(): def get_radarr_platform():
use_radarr = settings.general.getboolean('use_radarr') use_radarr = settings.general.getboolean('use_radarr')
apikey_radarr = settings.radarr.apikey apikey_radarr = settings.radarr.apikey
rv = url_radarr + "/api/system/status?apikey=" + apikey_radarr rv = url_radarr() + "/api/system/status?apikey=" + apikey_radarr
radarr_platform = '' radarr_platform = ''
if use_radarr: if use_radarr:
try: try:

Loading…
Cancel
Save