Merge remote-tracking branch 'origin/development' into updater

pull/388/head
Halali 6 years ago
commit a05e4c7724

@ -13,6 +13,8 @@ def get_args():
config_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
parser.add_argument('-c', '--config', default=config_dir, type=str, metavar="DIR",
dest="config_dir", help="Directory containing the configuration (default: %s)" % config_dir)
parser.add_argument('-p', '--port', type=int, metavar="PORT", dest="port",
help="Port number (default: 6767)")
parser.add_argument('--no-update', default=False, type=bool, const=True, metavar="BOOL", nargs="?",
help="Disable update functionality (default: False)")
parser.add_argument('--debug', default=False, type=bool, const=True, metavar="BOOL", nargs="?",

@ -84,11 +84,15 @@ def sync_episodes():
resolution = str(episode['episodeFile']['quality']['quality']['resolution']) + 'p'
if 'mediaInfo' in episode['episodeFile']:
videoCodec = episode['episodeFile']['mediaInfo']['videoCodec']
videoCodec = SonarrFormatVideoCodec(videoCodec)
audioCodec = episode['episodeFile']['mediaInfo']['audioCodec']
audioCodec = SonarrFormatAudioCodec(audioCodec)
if 'videoCodec' in episode['episodeFile']['mediaInfo']:
videoCodec = episode['episodeFile']['mediaInfo']['videoCodec']
videoCodec = SonarrFormatVideoCodec(videoCodec)
else: videoCodec = None
if 'audioCodec' in episode['episodeFile']['mediaInfo']:
audioCodec = episode['episodeFile']['mediaInfo']['audioCodec']
audioCodec = SonarrFormatAudioCodec(audioCodec)
else: audioCodec = None
else:
videoCodec = None
audioCodec = None

@ -87,16 +87,18 @@ def update_movies():
resolution = movie['movieFile']['quality']['quality']['resolution'].lstrip('r').lower()
if 'mediaInfo' in movie['movieFile']:
videoFormat = movie['movieFile']['mediaInfo']['videoFormat']
videoCodecID = movie['movieFile']['mediaInfo']['videoCodecID']
videoProfile = movie['movieFile']['mediaInfo']['videoProfile']
videoCodecLibrary = movie['movieFile']['mediaInfo']['videoCodecLibrary']
videoFormat = videoCodecID = videoProfile = videoCodecLibrary = None
if 'videoFormat' in movie['movieFile']['mediaInfo']: videoFormat = movie['movieFile']['mediaInfo']['videoFormat']
if 'videoCodecID' in movie['movieFile']['mediaInfo']: videoCodecID = movie['movieFile']['mediaInfo']['videoCodecID']
if 'videoProfile' in movie['movieFile']['mediaInfo']: videoProfile = movie['movieFile']['mediaInfo']['videoProfile']
if 'videoCodecLibrary' in movie['movieFile']['mediaInfo']: videoCodecLibrary = movie['movieFile']['mediaInfo']['videoCodecLibrary']
videoCodec = RadarrFormatVideoCodec(videoFormat, videoCodecID, videoProfile, videoCodecLibrary)
audioFormat = movie['movieFile']['mediaInfo']['audioFormat']
audioCodecID = movie['movieFile']['mediaInfo']['audioCodecID']
audioProfile = movie['movieFile']['mediaInfo']['audioProfile']
audioAdditionalFeatures = movie['movieFile']['mediaInfo']['audioAdditionalFeatures']
audioFormat = audioCodecID = audioProfile = audioAdditionalFeatures = None
if 'audioFormat' in movie['movieFile']['mediaInfo']: audioFormat = movie['movieFile']['mediaInfo']['audioFormat']
if 'audioCodecID' in movie['movieFile']['mediaInfo']: audioCodecID = movie['movieFile']['mediaInfo']['audioCodecID']
if 'audioProfile' in movie['movieFile']['mediaInfo']: audioProfile = movie['movieFile']['mediaInfo']['audioProfile']
if 'audioAdditionalFeatures' in movie['movieFile']['mediaInfo']: audioAdditionalFeatures = movie['movieFile']['mediaInfo']['audioAdditionalFeatures']
audioCodec = RadarrFormatAudioCodec(audioFormat, audioCodecID, audioProfile, audioAdditionalFeatures)
else:
videoCodec = None

@ -1888,12 +1888,10 @@ def handle_websocket():
# Mute DeprecationWarning
warnings.simplefilter("ignore", DeprecationWarning)
server = WSGIServer((str(settings.general.ip), int(settings.general.port)), app, handler_class=WebSocketHandler)
server = WSGIServer((str(settings.general.ip), (int(args.port) if args.port else int(settings.general.port))), app, handler_class=WebSocketHandler)
try:
logging.info('BAZARR is started and waiting for request on http://' + str(settings.general.ip) + ':' + str(
settings.general.port) + str(base_url))
# print 'Bazarr is started and waiting for request on http://' + str(ip) + ':' + str(port) + str(base_url)
logging.info('BAZARR is started and waiting for request on http://' + str(settings.general.ip) + ':' + (str(
args.port) if args.port else str(settings.general.port)) + str(base_url))
server.serve_forever()
except KeyboardInterrupt:
shutdown()

@ -192,8 +192,9 @@
});
% from config import settings
% from get_args import args
% ip = settings.general.ip
% port = settings.general.port
% port = args.port if args.port else settings.general.port
% base_url = settings.general.base_url
if ("{{ip}}" === "0.0.0.0") {

@ -385,8 +385,9 @@
});
% from config import settings
% from get_args import args
% ip = settings.general.ip
% port = settings.general.port
% port = args.port if args.port else settings.general.port
% base_url = settings.general.base_url
if ("{{ip}}" === "0.0.0.0") {

Loading…
Cancel
Save