mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
feat(dl): add tag_rules to conditionally swap the group tag
This commit is contained in:
@@ -95,6 +95,9 @@ class Title:
|
||||
"hfr": "",
|
||||
"edition": "",
|
||||
"lang_tag": "",
|
||||
"title_type": {"Movie": "movie", "Episode": "series", "Song": "music"}.get(
|
||||
type(self).__name__, type(self).__name__.lower()
|
||||
),
|
||||
}
|
||||
|
||||
if self.tracks:
|
||||
@@ -199,6 +202,13 @@ class Title:
|
||||
sub_langs = [s.language for s in self.tracks.subtitles]
|
||||
context["lang_tag"] = evaluate_language_tag(lang_tag_rules, audio_langs, sub_langs)
|
||||
|
||||
if config.tag_rules:
|
||||
from unshackle.core.utils.tag_rules import evaluate_tag_rules
|
||||
|
||||
override = evaluate_tag_rules(config.tag_rules, context)
|
||||
if override:
|
||||
context["tag"] = override
|
||||
|
||||
return context
|
||||
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user