From 6b8a59bffb4d9dd57ee2c9ad66c35685d673e63b Mon Sep 17 00:00:00 2001 From: Aurel004 Date: Thu, 23 Apr 2020 20:06:37 +0200 Subject: [PATCH] Adding Post processing to manual upload From dev branch --- bazarr/main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index 9367de65f..b836e1a67 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -1856,6 +1856,9 @@ def perform_manual_upload_subtitle(): sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrEpisodeId = request.forms.get('sonarrEpisodeId') title = request.forms.get('title') + + data = database.execute("SELECT audio_language FROM table_shows WHERE sonarrSeriesId=?", (sonarrSeriesId,), only_one=True) + audio_language = data['audio_language'] _, ext = os.path.splitext(upload.filename) @@ -1869,7 +1872,8 @@ def perform_manual_upload_subtitle(): title=title, scene_name=sceneName, media_type='series', - subtitle=upload) + subtitle=upload, + audio_language=audio_language)) if result is not None: message = result[0] @@ -1995,6 +1999,9 @@ def perform_manual_upload_subtitle_movie(): upload = request.files.get('upload') radarrId = request.forms.get('radarrId') title = request.forms.get('title') + + data = database.execute("SELECT audio_language FROM table_movies WHERE radarrId=?", (radarrId,), only_one=True) + audio_language = data['audio_language'] _, ext = os.path.splitext(upload.filename) @@ -2008,7 +2015,8 @@ def perform_manual_upload_subtitle_movie(): title=title, scene_name=sceneName, media_type='movie', - subtitle=upload) + subtitle=upload, + audio_language=audio_language) if result is not None: message = result[0]