refactor: extract source-neutral playlist curation (#860)

* refactor: extract source-neutral playlist curation

* fix: keep curation matches within media kind

---------

Co-authored-by: Juanjo Presa <juanjop@gmail.com>
This commit is contained in:
Juanjo Presa
2026-09-09 20:40:53 +02:00
committed by GitHub
co-authored by Juanjo Presa
parent 019fb7fde2
commit 145b082a4f
24 changed files with 1574 additions and 1200 deletions
-2
View File
@@ -79,7 +79,6 @@ pub struct Constants {
pub export_style_config: ExportStyleConfig,
pub country_codes: HashSet<&'static str>,
pub allowed_output_formats: Vec<String>,
pub re_trakt_year: Regex,
pub re_quality: Regex,
pub re_classifier_year: Regex,
pub re_classifier_cleanup: Regex,
@@ -160,7 +159,6 @@ pub static CONSTANTS: LazyLock<Constants> = LazyLock::new(|| {
"to", "tt", "tn", "tr", "tm", "tv", "ug", "ua", "ae", "gb", "us", "uy", "uz", "vu", "va", "ve",
"vn", "ye", "zm", "zw", "sat", "4k",
].into_iter().collect::<HashSet<&str>>(),
re_trakt_year: Regex::new(r"\(?(\d{4})\)?$").unwrap(),
re_quality: Regex::new(r"(?i)\b(x265|4K|UHD|8K|2160p?|1080p?|720p?|480p?|BLURAY|HDTV|DVDRIP|BRRIP|CAM|TS|HDR|DV|SDR)\b").unwrap(),
re_classifier_year: Regex::new(r"[\(\[]?(\d{4})[\)\]]?").unwrap(),
re_classifier_cleanup: Regex::new(r"(?i)[\s\._-]*(?:s\d+e\d+|\d+x\d+|season[\s\._-]*\d+|episode[\s\._-]*\d+).*$").unwrap(),