From 90952844b27b50c106434cbc946effe1f5edfaae Mon Sep 17 00:00:00 2001 From: Vadim Yushmanov Date: Wed, 31 Aug 2022 13:47:26 +0300 Subject: [PATCH 1/2] Added support for Russian language --- main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.py b/main.py index 47f40c8..6caacc3 100644 --- a/main.py +++ b/main.py @@ -63,6 +63,8 @@ def subtitle_info_checker(subtitle_file_name: str) -> dict: JP_TC_LIST = [".jptc", "[jptc]", "jp_tc", "[jp_tc]", "cht&jap", "繁日"] # Jpn JP_LIST = [".jp", ".jpn", ".jap", "[jp]", "[jpn]", "[jap]"] + # Rus + RU_LIST = [".ru", ".rus", "[ru]", "[rus]"] if any(indicator in subtitle_file_name.lower() for indicator in JP_SC_LIST): language = "jp_sc" @@ -74,6 +76,8 @@ def subtitle_info_checker(subtitle_file_name: str) -> dict: language = "cht" elif any(indicator in subtitle_file_name.lower() for indicator in JP_LIST): language = "jpn" + elif any(indicator in subtitle_file_name.lower() for indicator in RU_LIST): + language = "rus" else: language = "" @@ -179,6 +183,9 @@ def is_font_file(f: str) -> bool: if this_sub_info["language"] == "jpn": this_sub_track = MKVTrack(item, track_name=track_name, default_track=True, language="jpn") + elif this_sub_info["language"] == "rus": + this_sub_track = MKVTrack(item, track_name=track_name, + default_track=True, language="rus") else: this_sub_track = MKVTrack(item, track_name=track_name, default_track=True, language="chi") @@ -228,6 +235,9 @@ def is_font_file(f: str) -> bool: if this_sub_info["language"] == "jpn": this_sub_track = MKVTrack(item, track_name=track_name, default_track=True, language="jpn") + elif this_sub_info["language"] == "rus": + this_sub_track = MKVTrack(item, track_name=track_name, + default_track=True, language="rus") else: this_sub_track = MKVTrack(item, track_name=track_name, default_track=True, language="chi") From 43a4634d3e3309e9f2d124658a85c074974fa780 Mon Sep 17 00:00:00 2001 From: vvyushmanov <111231219+vvyushmanov@users.noreply.github.com> Date: Wed, 31 Aug 2022 14:02:10 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 976aa86..3314507 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,13 @@ English README | [中文 README](https://github.com/Masterain98/PlexMuxy/blob/ma - Usually are external 5.1 Channel audio and audio commentary - Subtitle - - Determine the language by file name, including Simplified Chinese, Traditional Chinese, Japanese, SC&JP, TC&JP + - Determine the language by file name, including Simplified Chinese, Traditional Chinese, Japanese, SC&JP, TC&JP, Russian - For Simplified Chinese, track name will be `chs` , and language is marked as `chi` - For Traditional Chinese, track name will be `cht`, and language is marked as `chi` - For Japanese, track name will be `jpn` and language is marked as `jpn` - For SC&JP, track name will be `jp_sc` and language is marked as `chi` - For TC&JP, track name will be `jp_tc` and language is marked as `chi` + - For Russian, track name will be `rus` and language is marked as `rus` - Determine the subtitle author by file name @@ -77,6 +78,8 @@ English README | [中文 README](https://github.com/Masterain98/PlexMuxy/blob/ma | `.chs`, `.sc`, `[chs]`, `[sc]`, `.gb`, `[gb]` | chs | | `.cht`, `.tc`, `[cht]`, `[tc]`, `big5`, `[big5]` | cht | | `.jp`, `.jpn`, `.jap`, `[jp]`, `[jpn]`, `[jap]` | jpn | + | `.ru`, `.rus`, `[ru]`, `[rus]` | rus | + - If the file name starts with `[`, and the following characters until next `]` will be considered as subtitle author and marked in the track name