Fix source mappings

This commit is contained in:
Johan van Eck 2025-07-27 15:28:15 +03:00
parent f8026fc849
commit e48af3aba1
193 changed files with 548 additions and 523 deletions

View file

@ -4,6 +4,7 @@ import yaml
from markdownify import markdownify
from utils.source import SOURCE_MAPPING
from utils.strings import get_name
IMPLEMENTATION_TO_TAG_MAPPING = {
@ -56,7 +57,9 @@ def collect_custom_format(service, file_name, input_json, output_dir):
elif implementation in ["ResolutionSpecification"]:
condition["resolution"] = f"{spec.get('fields', {}).get('value')}p"
elif implementation in ["SourceSpecification"]:
condition["source"] = spec.get("fields", {}).get("value")
condition["source"] = SOURCE_MAPPING[service][
spec.get("fields", {}).get("value")
]
elif implementation in ["LanguageSpecification"]:
# TODO: exceptLanguage
condition["language"] = spec.get("fields", {}).get("value")

22
scripts/utils/source.py Normal file
View file

@ -0,0 +1,22 @@
SOURCE_MAPPING = {
"radarr": {
1: "cam",
2: "telesync",
3: "telecine",
4: "workprint",
5: "dvd",
6: "tv",
7: "web_dl",
8: "webrip",
9: "bluray",
},
"sonarr": {
1: "television",
2: "televisionraw",
3: "web_dl",
4: "webrip",
5: "dvd",
6: "bluray",
7: "blurayraw",
},
}