fix ensure upgrade_until shows is processed correctly
This commit is contained in:
parent
f2c276cbbb
commit
079e77a882
27 changed files with 108 additions and 1 deletions
|
|
@ -55,6 +55,10 @@ qualities:
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
- id: 8
|
- id: 8
|
||||||
name: Remux-1080p
|
name: Remux-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux 1080p
|
||||||
|
id: -4
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: Anime BD Tier 01 (Top SeaDex Muxers)
|
- name: Anime BD Tier 01 (Top SeaDex Muxers)
|
||||||
score: 1400
|
score: 1400
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- id: 10
|
- id: 10
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray|WEB 1080p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: 'Language: Not Original'
|
- name: 'Language: Not Original'
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ qualities:
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
- name: Remux-1080p
|
- name: Remux-1080p
|
||||||
id: 8
|
id: 8
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-1080p
|
||||||
|
id: 8
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: 'Language: Not Original'
|
- name: 'Language: Not Original'
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- id: 4
|
- id: 4
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray|WEB 2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: 'Language: Not Original'
|
- name: 'Language: Not Original'
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ qualities:
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
- name: Remux-2160p
|
- name: Remux-2160p
|
||||||
id: 3
|
id: 3
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-2160p
|
||||||
|
id: 3
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: 'Language: Not Original'
|
- name: 'Language: Not Original'
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- id: 10
|
- id: 10
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Merged QPs
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: German 1080p Booster
|
- name: German 1080p Booster
|
||||||
score: 650
|
score: 650
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- id: 8
|
- id: 8
|
||||||
name: Remux-1080p
|
name: Remux-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Merged QPs
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: German 1080p Booster
|
- name: German 1080p Booster
|
||||||
score: 650
|
score: 650
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ qualities:
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
- id: 3
|
- id: 3
|
||||||
name: Remux-2160p
|
name: Remux-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: Merged QPs
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: German 1080p Booster
|
- name: German 1080p Booster
|
||||||
score: 650
|
score: 650
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ qualities:
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
- id: 4
|
- id: 4
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: Merged QPs
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: German 1080p Booster
|
- name: German 1080p Booster
|
||||||
score: 650
|
score: 650
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ qualities:
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
- id: 4
|
- id: 4
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: Merged QPs
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: German 1080p Booster
|
- name: German 1080p Booster
|
||||||
score: 650
|
score: 650
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- id: 10
|
- id: 10
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray|WEB-1080p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: TrueHD ATMOS
|
- name: TrueHD ATMOS
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- name: Bluray-2160p
|
- name: Bluray-2160p
|
||||||
id: 4
|
id: 4
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray-2160p
|
||||||
|
id: 4
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: TrueHD ATMOS
|
- name: TrueHD ATMOS
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- id: 10
|
- id: 10
|
||||||
name: Bluray-1080p
|
name: Bluray-1080p
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray|WEB-1080p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: TrueHD ATMOS
|
- name: TrueHD ATMOS
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,10 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- id: 4
|
- id: 4
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray|WEB-2160p
|
||||||
|
id: -2
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: TrueHD ATMOS
|
- name: TrueHD ATMOS
|
||||||
score: -10000
|
score: -10000
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ qualities:
|
||||||
name: Remux-2160p
|
name: Remux-2160p
|
||||||
- id: 4
|
- id: 4
|
||||||
name: Bluray-2160p
|
name: Bluray-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: WEB|Remux|Bluray|2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ qualities:
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
- id: 3
|
- id: 3
|
||||||
name: Remux-2160p
|
name: Remux-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: WEB|Remux|2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: TrueHD Atmos
|
- name: TrueHD Atmos
|
||||||
score: 5000
|
score: 5000
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- id: 3
|
- id: 3
|
||||||
name: Remux-2160p
|
name: Remux-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: WEB|Remux|2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,10 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- id: 5
|
- id: 5
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: WEB|2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- id: 5
|
- id: 5
|
||||||
name: WEBDL-2160p
|
name: WEBDL-2160p
|
||||||
|
upgrade_until:
|
||||||
|
name: WEBDL|Bluray|2160p
|
||||||
|
id: -1
|
||||||
|
description: ''
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- name: Bluray-1080p
|
- name: Bluray-1080p
|
||||||
id: 10
|
id: 10
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray-1080p
|
||||||
|
id: 10
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: HD Bluray Tier 01
|
- name: HD Bluray Tier 01
|
||||||
score: 1800
|
score: 1800
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ qualities:
|
||||||
name: WEBRip-1080p
|
name: WEBRip-1080p
|
||||||
- name: Remux-1080p
|
- name: Remux-1080p
|
||||||
id: 8
|
id: 8
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-1080p
|
||||||
|
id: 8
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: Remux Tier 01
|
- name: Remux Tier 01
|
||||||
score: 1950
|
score: 1950
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- name: Remux-2160p
|
- name: Remux-2160p
|
||||||
id: 3
|
id: 3
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-2160p
|
||||||
|
id: 3
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,9 @@ qualities:
|
||||||
id: 4
|
id: 4
|
||||||
- name: Remux-2160p
|
- name: Remux-2160p
|
||||||
id: 3
|
id: 3
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-2160p
|
||||||
|
id: 3
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ qualities:
|
||||||
id: 4
|
id: 4
|
||||||
- name: Remux-2160p
|
- name: Remux-2160p
|
||||||
id: 3
|
id: 3
|
||||||
|
upgrade_until:
|
||||||
|
name: Remux-2160p
|
||||||
|
id: 3
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ qualities:
|
||||||
name: WEBRip-2160p
|
name: WEBRip-2160p
|
||||||
- name: Bluray-2160p
|
- name: Bluray-2160p
|
||||||
id: 4
|
id: 4
|
||||||
|
upgrade_until:
|
||||||
|
name: Bluray-2160p
|
||||||
|
id: 4
|
||||||
custom_formats:
|
custom_formats:
|
||||||
- name: DV HDR10Plus
|
- name: DV HDR10Plus
|
||||||
score: 1500
|
score: 1500
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,15 @@
|
||||||
# ///
|
# ///
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import yaml
|
||||||
|
|
||||||
from utils.custom_formats import collect_custom_formats
|
from utils.custom_formats import collect_custom_formats
|
||||||
from utils.regex_patterns import collect_regex_patterns
|
from utils.regex_patterns import collect_regex_patterns
|
||||||
from utils.profiles import collect_profiles
|
from utils.profiles import collect_profiles
|
||||||
|
|
||||||
|
# Prevent aliases from showing up
|
||||||
|
yaml.Dumper.ignore_aliases = lambda *args: True
|
||||||
|
|
||||||
|
|
||||||
def clear_output_dir(output_dir):
|
def clear_output_dir(output_dir):
|
||||||
if not os.path.exists(output_dir):
|
if not os.path.exists(output_dir):
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,21 @@ def collect_qualities(items):
|
||||||
return qualities
|
return qualities
|
||||||
|
|
||||||
|
|
||||||
|
def get_upgrade_until(quality_name, profile_qualities):
|
||||||
|
found_quality = next(
|
||||||
|
quality for quality in profile_qualities if quality["name"] == quality_name
|
||||||
|
)
|
||||||
|
if found_quality:
|
||||||
|
found_quality = found_quality.copy()
|
||||||
|
found_quality.pop("qualities", None)
|
||||||
|
return found_quality
|
||||||
|
|
||||||
|
|
||||||
def collect_profile(service, input_json, output_dir):
|
def collect_profile(service, input_json, output_dir):
|
||||||
# Compose YAML structure
|
# Compose YAML structure
|
||||||
name = input_json.get("name", "")
|
name = input_json.get("name", "")
|
||||||
trash_id = input_json.get("trash_id", "")
|
trash_id = input_json.get("trash_id", "")
|
||||||
|
profile_qualities = collect_qualities(input_json.get("items", []))
|
||||||
yml_data = {
|
yml_data = {
|
||||||
"name": get_file_name(name),
|
"name": get_file_name(name),
|
||||||
"description": f"""[Profile from TRaSH-Guides.](https://trash-guides.info/{service.capitalize()}/{service}-setup-quality-profiles)
|
"description": f"""[Profile from TRaSH-Guides.](https://trash-guides.info/{service.capitalize()}/{service}-setup-quality-profiles)
|
||||||
|
|
@ -112,7 +123,8 @@ def collect_profile(service, input_json, output_dir):
|
||||||
"minCustomFormatScore": input_json.get("minFormatScore", 0),
|
"minCustomFormatScore": input_json.get("minFormatScore", 0),
|
||||||
"upgradeUntilScore": input_json.get("cutoffFormatScore", 0),
|
"upgradeUntilScore": input_json.get("cutoffFormatScore", 0),
|
||||||
"minScoreIncrement": input_json.get("minUpgradeFormatScore", 0),
|
"minScoreIncrement": input_json.get("minUpgradeFormatScore", 0),
|
||||||
"qualities": collect_qualities(input_json.get("items", [])),
|
"qualities": profile_qualities,
|
||||||
|
"upgrade_until": get_upgrade_until(input_json.get("cutoff"), profile_qualities),
|
||||||
"custom_formats": collect_profile_formats(
|
"custom_formats": collect_profile_formats(
|
||||||
input_json.get("trash_score_set"),
|
input_json.get("trash_score_set"),
|
||||||
input_json.get("formatItems", {}),
|
input_json.get("formatItems", {}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue