diff options
author | JayZed <[email protected]> | 2024-01-05 21:43:37 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-05 21:43:37 -0500 |
commit | 0ac9ecea6e7bae6828441ac3c8eece58f68c88fa (patch) | |
tree | 0d0354f15a56178a2f1878caa4f48f8fc7fdf205 | |
parent | c0bbd4f150c6a0a48cba5c3d028299e0eec1d316 (diff) | |
download | bazarr-0ac9ecea6e7bae6828441ac3c8eece58f68c88fa.tar.gz bazarr-0ac9ecea6e7bae6828441ac3c8eece58f68c88fa.zip |
Added additional variables for custom post processingv1.4.1-beta.13
-rw-r--r-- | bazarr/subtitles/processing.py | 4 | ||||
-rw-r--r-- | bazarr/subtitles/upload.py | 2 | ||||
-rw-r--r-- | bazarr/utilities/post_processing.py | 5 | ||||
-rw-r--r-- | frontend/src/pages/Settings/Subtitles/index.tsx | 8 |
4 files changed, 16 insertions, 3 deletions
diff --git a/bazarr/subtitles/processing.py b/bazarr/subtitles/processing.py index 34538b147..2144e9175 100644 --- a/bazarr/subtitles/processing.py +++ b/bazarr/subtitles/processing.py @@ -43,6 +43,8 @@ def process_subtitle(subtitle, media_type, audio_language, path, max_score, is_u postprocessing_cmd = settings.general.postprocessing_cmd downloaded_provider = subtitle.provider_name + uploader = subtitle.uploader + release_info = subtitle.release_info downloaded_language_code3 = _get_download_code3(subtitle) downloaded_language = language_from_alpha3(downloaded_language_code3) @@ -111,7 +113,7 @@ def process_subtitle(subtitle, media_type, audio_language, path, max_score, is_u if use_postprocessing is True: command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language, downloaded_language_code2, downloaded_language_code3, audio_language, audio_language_code2, audio_language_code3, - percent_score, subtitle_id, downloaded_provider, series_id, episode_id) + percent_score, subtitle_id, downloaded_provider, uploader, release_info, series_id, episode_id) if media_type == 'series': use_pp_threshold = settings.general.use_postprocessing_threshold diff --git a/bazarr/subtitles/upload.py b/bazarr/subtitles/upload.py index 998e63c21..aaeca7258 100644 --- a/bazarr/subtitles/upload.py +++ b/bazarr/subtitles/upload.py @@ -151,7 +151,7 @@ def manual_upload_subtitle(path, language, forced, hi, media_type, subtitle, aud if use_postprocessing: command = pp_replace(postprocessing_cmd, path, subtitle_path, uploaded_language, uploaded_language_code2, uploaded_language_code3, audio_language['name'], audio_language['code2'], - audio_language['code3'], 100, "1", "manual", series_id, episode_id) + audio_language['code3'], 100, "1", "manual", "user", "unknown", series_id, episode_id) postprocessing(command, path) set_chmod(subtitles_path=subtitle_path) diff --git a/bazarr/utilities/post_processing.py b/bazarr/utilities/post_processing.py index 673810241..c1e5d810d 100644 --- a/bazarr/utilities/post_processing.py +++ b/bazarr/utilities/post_processing.py @@ -16,7 +16,8 @@ def _escape(in_str): def pp_replace(pp_command, episode, subtitles, language, language_code2, language_code3, episode_language, - episode_language_code2, episode_language_code3, score, subtitle_id, provider, series_id, episode_id): + episode_language_code2, episode_language_code3, score, subtitle_id, provider, uploader, + release_info, series_id, episode_id): pp_command = re.sub(r'[\'"]?{{directory}}[\'"]?', _escape(os.path.dirname(episode)), pp_command) pp_command = re.sub(r'[\'"]?{{episode}}[\'"]?', _escape(episode), pp_command) pp_command = re.sub(r'[\'"]?{{episode_name}}[\'"]?', _escape(os.path.splitext(os.path.basename(episode))[0]), @@ -35,6 +36,8 @@ def pp_replace(pp_command, episode, subtitles, language, language_code2, languag pp_command = re.sub(r'[\'"]?{{score}}[\'"]?', _escape(str(score)), pp_command) pp_command = re.sub(r'[\'"]?{{subtitle_id}}[\'"]?', _escape(str(subtitle_id)), pp_command) pp_command = re.sub(r'[\'"]?{{provider}}[\'"]?', _escape(str(provider)), pp_command) + pp_command = re.sub(r'[\'"]?{{uploader}}[\'"]?', _escape(str(uploader)), pp_command) + pp_command = re.sub(r'[\'"]?{{release_info}}[\'"]?', _escape(str(release_info)), pp_command) pp_command = re.sub(r'[\'"]?{{series_id}}[\'"]?', _escape(str(series_id)), pp_command) pp_command = re.sub(r'[\'"]?{{episode_id}}[\'"]?', _escape(str(episode_id)), pp_command) return pp_command diff --git a/frontend/src/pages/Settings/Subtitles/index.tsx b/frontend/src/pages/Settings/Subtitles/index.tsx index ee0dda2ce..51d59675e 100644 --- a/frontend/src/pages/Settings/Subtitles/index.tsx +++ b/frontend/src/pages/Settings/Subtitles/index.tsx @@ -99,6 +99,14 @@ const commandOptions: CommandOption[] = [ description: "Provider of the subtitle file", }, { + option: "uploader", + description: "Uploader of the subtitle file", + }, + { + option: "release_info", + description: "Release info for the subtitle file", + }, + { option: "series_id", description: "Sonarr series ID (Empty if movie)", }, |