Skip to content

Commit

Permalink
fix stream_tag_language calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
yajrendrag committed Jul 15, 2024
1 parent 8e46d98 commit 29648ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/keep_stream_by_language/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

**<span style="color:#56adda">0.1.2</span>**
- fix error in iso language check in stream_tag_language in test streams function (last line wasn't edited properly in cut/paste)

**<span style="color:#56adda">0.1.1</span>**
- add test for None on iso639 Language.match
- update version to 0.1.x series
Expand Down
2 changes: 1 addition & 1 deletion source/keep_stream_by_language/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"on_worker_process": 1
},
"tags": "audio,subtitle, ffmpeg,library file test",
"version": "0.1.1"
"version": "0.1.2"
}
2 changes: 1 addition & 1 deletion source/keep_stream_by_language/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_tags_for_search_string(self, codec_type, stream_tags, stream_id):
stream_tag_language = iso639.Language.match(stream_tags.get('language', '').lower()).part1 if iso639.Language.match(stream_tags.get('language', '').lower()).part1 is not None and stream_tags.get('language', '').lower() in iso639.Language.match(stream_tags.get('language', '').lower()).part1 else \
iso639.Language.match(stream_tags.get('language', '').lower()).part2b if iso639.Language.match(stream_tags.get('language', '').lower()).part2b is not None and stream_tags.get('language', '').lower() in iso639.Language.match(stream_tags.get('language', '').lower()).part2b else \
iso639.Language.match(stream_tags.get('language', '').lower()).part2t if iso639.Language.match(stream_tags.get('language', '').lower()).part2t is not None and stream_tags.get('language', '').lower() in iso639.Language.match(stream_tags.get('language', '').lower()).part2t else \
iso639.Language.match(stream_tags.get('language', '').lower()).part2b if stream_tags.get('language', '').lower() in iso639.Language.match(stream_tags.get('language', '').lower()).part2b else ""
iso639.Language.match(stream_tags.get('language', '').lower()).part3 if iso639.Language.match(stream_tags.get('language', '').lower()).part3 is not None and stream_tags.get('language', '').lower() in iso639.Language.match(stream_tags.get('language', '').lower()).part3 else ""
except iso639.language.LanguageNotFoundError:
raise iso639.language.LanguageNotFoundError("stream tag language: ", stream_tags.get('language', '').lower())
if language and (language.lower() in stream_tag_language or language.lower() == '*'):
Expand Down

0 comments on commit 29648ea

Please sign in to comment.