diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e85fdf..4b4eb11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,18 @@ callers). each documenting an expected `ParsedRelease` plus the future `routing` (library / torrents / seed_hardlinks) for the upcoming `organize_media` refactor. EASY bucket seeded with 5 cases (movie, single-episode, season - pack, movie + noise, YTS bracket-heavy). Parametrized over - `tests/domain/test_release_fixtures.py` for anti-regression. + pack, movie + noise, YTS bracket-heavy). SHITTY bucket seeded with 15 + anti-regression cases covering: 3-level INTEGRALE hierarchy (Angel), + French custom titles (Buffy, La Nuit au Musée, Chérie j'ai agrandi), + multi-episode chain `S14E09E10E11` (Archer, captures E11 loss), + lowercase `s01e01` (Notre Planète), `NxNN` with ` - ` separators + (Vinyl, captures dash artifact), title-with-year-suffix (Deutschland.83), + season-range `S01-06` (Tatortreiniger, captures movie misclassification), + duplicated title (Derry Girls), bare folder name (Jurassic Park, + media_type=unknown), apostrophe-in-name (Honey Don't, captures full AI-path + degeneration), SUBS-tag movie (Hook), space separators (Predator Badlands, + captures group=UNKNOWN), subs-only release (Westworld S04). + Parametrized over `tests/domain/test_release_fixtures.py` for anti-regression. - **`NxNN` alt season/episode form supported** by `parse_release`. Releases like `Show.1x05.720p.HDTV.x264-GRP` and `Show.2x07x08.1080p.WEB.x265-GRP` (multi-ep alt form) now parse as TV shows. diff --git a/tests/fixtures/releases/shitty/angel_three_level_hierarchy/expected.yaml b/tests/fixtures/releases/shitty/angel_three_level_hierarchy/expected.yaml new file mode 100644 index 0000000..86d3f1b --- /dev/null +++ b/tests/fixtures/releases/shitty/angel_three_level_hierarchy/expected.yaml @@ -0,0 +1,50 @@ +release_name: "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO" + +# INTEGRALE token correctly drives media_type=tv_complete + edition=INTEGRALE. +# No season numbers anywhere in the release name — folder hierarchy carries +# the season info. The organiser will need to walk the tree to learn seasons. +parsed: + title: "Angel" + year: null + season: null + episode: null + quality: "1080p" + source: "BluRay" + codec: "x265" + group: "FRANCISCO" + tech_string: "1080p.BluRay.x265" + media_type: "tv_complete" + edition: "INTEGRALE" + languages: ["MULTI"] + parse_path: "direct" + is_season_pack: false + +tree: + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Bonus/" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Bonus/Making.Of.mkv" + +# Bonus/ is parasitic (not in the show canon) — stays with torrents only. +routing: + library: + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + torrents: + - "Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/" + seed_hardlinks: + - source: "library/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + target: "torrents/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - source: "library/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + target: "torrents/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 1/Angel.S01E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - source: "library/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + target: "torrents/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E01.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + - source: "library/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" + target: "torrents/Angel.INTEGRALE.MULTI.1080p.BluRay.x265-FRANCISCO/Saison 2/Angel.S02E02.MULTI.1080p.BluRay.x265-FRANCISCO.mkv" diff --git a/tests/fixtures/releases/shitty/archer_multi_episode/expected.yaml b/tests/fixtures/releases/shitty/archer_multi_episode/expected.yaml new file mode 100644 index 0000000..c63881d --- /dev/null +++ b/tests/fixtures/releases/shitty/archer_multi_episode/expected.yaml @@ -0,0 +1,33 @@ +release_name: "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL" + +# Tech debt: triple-episode chain (E09E10E11) — current parser captures +# episode=9 and episode_end=10, but E11 is lost. Anti-regression: lock in +# the partial behavior so any future improvement is intentional. +parsed: + title: "Archer" + year: null + season: 14 + episode: 9 + episode_end: 10 + quality: "1080p" + source: "WEB" + codec: "h264" + group: "ETHEL" + tech_string: "1080p.WEB.h264" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: false + +tree: + - "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/" + - "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL.mkv" + - "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/RARBG.txt" + +routing: + library: + - "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL.mkv" + torrents: + - "Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/" + seed_hardlinks: + - source: "library/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL.mkv" + target: "torrents/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL/Archer.S14E09E10E11.1080p.WEB.h264-ETHEL.mkv" diff --git a/tests/fixtures/releases/shitty/buffy_custom_french/expected.yaml b/tests/fixtures/releases/shitty/buffy_custom_french/expected.yaml new file mode 100644 index 0000000..e7e4eb3 --- /dev/null +++ b/tests/fixtures/releases/shitty/buffy_custom_french/expected.yaml @@ -0,0 +1,39 @@ +release_name: "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD" + +# French-localized title with dots kept as part of the title (no +# title-casing or smart-Detection). is_season_pack=True from S01 + no episode. +parsed: + title: "Buffy.contre.les.Vampires" + year: null + season: 1 + episode: null + quality: "1080p" + source: "WEB-DL" + codec: "x264" + group: "FRENCHWORLD" + tech_string: "1080p.WEB-DL.x264" + media_type: "tv_show" + languages: ["FRENCH"] + parse_path: "direct" + is_season_pack: true + +tree: + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/" + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E02.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E03.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + +routing: + library: + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E02.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E03.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + torrents: + - "Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/" + seed_hardlinks: + - source: "library/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + target: "torrents/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - source: "library/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E02.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + target: "torrents/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E02.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + - source: "library/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E03.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" + target: "torrents/Buffy.contre.les.Vampires.S01.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD/Buffy.contre.les.Vampires.S01E03.FRENCH.1080p.WEB-DL.x264-FRENCHWORLD.mkv" diff --git a/tests/fixtures/releases/shitty/cherie_jai_agrandi_apostrophe/expected.yaml b/tests/fixtures/releases/shitty/cherie_jai_agrandi_apostrophe/expected.yaml new file mode 100644 index 0000000..825389b --- /dev/null +++ b/tests/fixtures/releases/shitty/cherie_jai_agrandi_apostrophe/expected.yaml @@ -0,0 +1,33 @@ +release_name: "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL" + +# Real title contains apostrophes ("Chérie, j'ai agrandi le bébé") stripped +# down to ASCII at release-name time. Parser handles it cleanly — title stays +# joined by dots, year and tech detected normally. +parsed: + title: "Cherie.Jai.Agrandi.Le.Bebe" + year: 1992 + season: null + episode: null + quality: "1080p" + source: "BluRay" + codec: "x264" + group: "FUTiL" + tech_string: "1080p.BluRay.x264" + media_type: "movie" + languages: ["FRENCH"] + parse_path: "direct" + is_season_pack: false + +tree: + - "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/" + - "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL.mkv" + - "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL.nfo" + +routing: + library: + - "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL.mkv" + torrents: + - "Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/" + seed_hardlinks: + - source: "library/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL.mkv" + target: "torrents/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL/Cherie.Jai.Agrandi.Le.Bebe.1992.FRENCH.1080p.BluRay.x264-FUTiL.mkv" diff --git a/tests/fixtures/releases/shitty/derry_duplicate_naming/expected.yaml b/tests/fixtures/releases/shitty/derry_duplicate_naming/expected.yaml new file mode 100644 index 0000000..012600d --- /dev/null +++ b/tests/fixtures/releases/shitty/derry_duplicate_naming/expected.yaml @@ -0,0 +1,35 @@ +release_name: "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb" + +# Show name appears twice in the release. Parser correctly resolves to a +# single title 'Derry.Girls' and season 3 — the duplication is harmless +# because the second S03 is just absorbed before tech tokens. +parsed: + title: "Derry.Girls" + year: null + season: 3 + episode: null + quality: "1080p" + source: "WEBRip" + codec: "x264" + group: "NTb" + tech_string: "1080p.WEBRip.x264" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: true + +tree: + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/" + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E01.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E02.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + +routing: + library: + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E01.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E02.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + torrents: + - "Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/" + seed_hardlinks: + - source: "library/Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E01.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + target: "torrents/Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E01.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + - source: "library/Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E02.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" + target: "torrents/Derry.Girls.S03.Derry.Girls.S03.1080p.NF.WEBRip.DDP5.1.x264-NTb/Derry.Girls.S03E02.1080p.NF.WEBRip.DDP5.1.x264-NTb.mkv" diff --git a/tests/fixtures/releases/shitty/deutschland_changing_name/expected.yaml b/tests/fixtures/releases/shitty/deutschland_changing_name/expected.yaml new file mode 100644 index 0000000..62e82b4 --- /dev/null +++ b/tests/fixtures/releases/shitty/deutschland_changing_name/expected.yaml @@ -0,0 +1,40 @@ +release_name: "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD" + +# Show title carries a year-like suffix that is *part of the title*, not the +# release year. Parser correctly keeps "Deutschland.83" intact (no year +# stripped) because '83' is too short for the YYYY heuristic. +parsed: + title: "Deutschland.83" + year: null + season: 1 + episode: null + quality: "1080p" + source: "BluRay" + codec: "x264" + group: "SHORTBREHD" + tech_string: "1080p.BluRay.x264" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: true + +# Real-world note: the franchise rebrands as Deutschland.86 / Deutschland.89 +# in later seasons — same downloads folder mixes the variants. Organiser +# will likely want a "show alias" layer eventually. +tree: + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/" + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E01.1080p.BluRay.x264-SHORTBREHD.mkv" + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E02.1080p.BluRay.x264-SHORTBREHD.mkv" + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Sample/" + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Sample/sample.mkv" + +routing: + library: + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E01.1080p.BluRay.x264-SHORTBREHD.mkv" + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E02.1080p.BluRay.x264-SHORTBREHD.mkv" + torrents: + - "Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/" + seed_hardlinks: + - source: "library/Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E01.1080p.BluRay.x264-SHORTBREHD.mkv" + target: "torrents/Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E01.1080p.BluRay.x264-SHORTBREHD.mkv" + - source: "library/Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E02.1080p.BluRay.x264-SHORTBREHD.mkv" + target: "torrents/Deutschland.83.S01.1080p.BluRay.x264-SHORTBREHD/Deutschland.83.S01E02.1080p.BluRay.x264-SHORTBREHD.mkv" diff --git a/tests/fixtures/releases/shitty/honey_uhd_hdr/expected.yaml b/tests/fixtures/releases/shitty/honey_uhd_hdr/expected.yaml new file mode 100644 index 0000000..ff6f975 --- /dev/null +++ b/tests/fixtures/releases/shitty/honey_uhd_hdr/expected.yaml @@ -0,0 +1,33 @@ +release_name: "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen" + +# Tech debt: the unescaped apostrophe in "Don't" pushes the whole release +# through the AI fallback path (parse_path="ai") and the parse degenerates to +# UNKNOWN across the board. Anti-regression here — once the tokenizer learns +# to handle apostrophes, this fixture should be revisited. +parsed: + title: "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen" + year: null + season: null + episode: null + quality: null + source: null + codec: null + group: "UNKNOWN" + tech_string: "" + media_type: "unknown" + parse_path: "ai" + is_season_pack: false + +tree: + - "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/" + - "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen.mkv" + - "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/RARBG_DO_NOT_MIRROR.exe" + +routing: + library: + - "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen.mkv" + torrents: + - "Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/" + seed_hardlinks: + - source: "library/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen.mkv" + target: "torrents/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen/Honey.Don't.2025.2160p.WEBRip.DSNP.DV.HDR.x265.EAC3.5.1-Amen.mkv" diff --git a/tests/fixtures/releases/shitty/hook_subs_in_name/expected.yaml b/tests/fixtures/releases/shitty/hook_subs_in_name/expected.yaml new file mode 100644 index 0000000..e87aa1a --- /dev/null +++ b/tests/fixtures/releases/shitty/hook_subs_in_name/expected.yaml @@ -0,0 +1,42 @@ +release_name: "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA" + +# The 'SUBS' marker advertises included subtitles in the release name itself +# but otherwise doesn't change the parse. Treat it like any other tag — +# don't drop it from raw, don't try to translate it into anything. +parsed: + title: "Hook" + year: 1991 + season: null + episode: null + quality: "1080p" + source: "BluRay" + codec: "x264" + group: "MELBA" + tech_string: "1080p.BluRay.x264" + media_type: "movie" + languages: ["MULTI"] + parse_path: "direct" + is_season_pack: false + +tree: + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA.mkv" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/fre.srt" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/eng.srt" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/spa.srt" + +routing: + library: + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA.mkv" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/fre.srt" + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/eng.srt" + torrents: + - "Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/" + seed_hardlinks: + - source: "library/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA.mkv" + target: "torrents/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA.mkv" + - source: "library/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/fre.srt" + target: "torrents/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/fre.srt" + - source: "library/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/eng.srt" + target: "torrents/Hook.1991.MULTi.SUBS.1080p.BluRay.x264-MELBA/Subs/eng.srt" diff --git a/tests/fixtures/releases/shitty/jurassic_minimal/expected.yaml b/tests/fixtures/releases/shitty/jurassic_minimal/expected.yaml new file mode 100644 index 0000000..bdd2f0a --- /dev/null +++ b/tests/fixtures/releases/shitty/jurassic_minimal/expected.yaml @@ -0,0 +1,31 @@ +release_name: "Jurassic Park" + +# Stripped-bare folder name — no year, no tech, no group. media_type=unknown +# is the right answer: the parser refuses to guess. Organiser will need +# user input (or TMDB lookup) to disambiguate. +parsed: + title: "Jurassic.Park" + year: null + season: null + episode: null + quality: null + source: null + codec: null + group: "UNKNOWN" + tech_string: "" + media_type: "unknown" + parse_path: "direct" + is_season_pack: false + +tree: + - "Jurassic Park/" + - "Jurassic Park/Jurassic.Park.1993.mkv" + +routing: + library: + - "Jurassic Park/Jurassic.Park.1993.mkv" + torrents: + - "Jurassic Park/" + seed_hardlinks: + - source: "library/Jurassic Park/Jurassic.Park.1993.mkv" + target: "torrents/Jurassic Park/Jurassic.Park.1993.mkv" diff --git a/tests/fixtures/releases/shitty/notre_planete_lowercase_e/expected.yaml b/tests/fixtures/releases/shitty/notre_planete_lowercase_e/expected.yaml new file mode 100644 index 0000000..e54ecfe --- /dev/null +++ b/tests/fixtures/releases/shitty/notre_planete_lowercase_e/expected.yaml @@ -0,0 +1,30 @@ +release_name: "Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb" + +# Lowercase 's01e01' and lowercased title word ('planete') correctly parsed. +# NF (Netflix) source tag is not in the source KB — drops; WEB-DL wins. +parsed: + title: "Notre.planete" + year: null + season: 1 + episode: 1 + quality: "1080p" + source: "WEB-DL" + codec: "x264" + group: "NTb" + tech_string: "1080p.WEB-DL.x264" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: false + +tree: + - "Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/" + - "Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb.mkv" + +routing: + library: + - "Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb.mkv" + torrents: + - "Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/" + seed_hardlinks: + - source: "library/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb.mkv" + target: "torrents/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb/Notre.planete.s01e01.1080p.NF.WEB-DL.DDP5.1.x264-NTb.mkv" diff --git a/tests/fixtures/releases/shitty/nuit_au_musee_bilingual/expected.yaml b/tests/fixtures/releases/shitty/nuit_au_musee_bilingual/expected.yaml new file mode 100644 index 0000000..a380bed --- /dev/null +++ b/tests/fixtures/releases/shitty/nuit_au_musee_bilingual/expected.yaml @@ -0,0 +1,40 @@ +release_name: "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST" + +# French title with MULTI audio. No year. Article 'La' preserved as part of +# the title — no smart article handling, which is the right call (cross-locale +# article stripping is fraught). +parsed: + title: "La.Nuit.au.Musee" + year: null + season: null + episode: null + quality: "1080p" + source: "BluRay" + codec: "x265" + group: "LOST" + tech_string: "1080p.BluRay.x265" + media_type: "movie" + languages: ["MULTI"] + parse_path: "direct" + is_season_pack: false + +tree: + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/" + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.mkv" + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.fre.srt" + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.eng.srt" + +routing: + library: + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.mkv" + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.fre.srt" + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.eng.srt" + torrents: + - "La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/" + seed_hardlinks: + - source: "library/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.mkv" + target: "torrents/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.mkv" + - source: "library/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.fre.srt" + target: "torrents/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.fre.srt" + - source: "library/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.eng.srt" + target: "torrents/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST/La.Nuit.au.Musee.MULTi.1080p.BluRay.x265-LOST.eng.srt" diff --git a/tests/fixtures/releases/shitty/predator_space_separators/expected.yaml b/tests/fixtures/releases/shitty/predator_space_separators/expected.yaml new file mode 100644 index 0000000..73a8166 --- /dev/null +++ b/tests/fixtures/releases/shitty/predator_space_separators/expected.yaml @@ -0,0 +1,31 @@ +release_name: "Predator Badlands 2025 1080p HDRip HEVC x265 BONE" + +# Space-separated release: tokenizer correctly splits and identifies year + +# tech, but the dash-before-group convention is absent so 'BONE' is not +# recognized as the group — falls to UNKNOWN. Anti-regression baseline. +parsed: + title: "Predator.Badlands" + year: 2025 + season: null + episode: null + quality: "1080p" + source: "HDRip" + codec: "x265" + group: "UNKNOWN" + tech_string: "1080p.HDRip.x265" + media_type: "movie" + parse_path: "direct" + is_season_pack: false + +tree: + - "Predator Badlands 2025 1080p HDRip HEVC x265 BONE/" + - "Predator Badlands 2025 1080p HDRip HEVC x265 BONE/Predator Badlands 2025 1080p HDRip HEVC x265 BONE.mkv" + +routing: + library: + - "Predator Badlands 2025 1080p HDRip HEVC x265 BONE/Predator Badlands 2025 1080p HDRip HEVC x265 BONE.mkv" + torrents: + - "Predator Badlands 2025 1080p HDRip HEVC x265 BONE/" + seed_hardlinks: + - source: "library/Predator Badlands 2025 1080p HDRip HEVC x265 BONE/Predator Badlands 2025 1080p HDRip HEVC x265 BONE.mkv" + target: "torrents/Predator Badlands 2025 1080p HDRip HEVC x265 BONE/Predator Badlands 2025 1080p HDRip HEVC x265 BONE.mkv" diff --git a/tests/fixtures/releases/shitty/tatortreiniger_flat_multiseason/expected.yaml b/tests/fixtures/releases/shitty/tatortreiniger_flat_multiseason/expected.yaml new file mode 100644 index 0000000..80ca66f --- /dev/null +++ b/tests/fixtures/releases/shitty/tatortreiniger_flat_multiseason/expected.yaml @@ -0,0 +1,44 @@ +release_name: "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE" + +# Tech debt: range syntax 'S01-06' is not recognized as TV — falls through +# to media_type=movie with the range glued onto the title. Captured here so a +# future ranger-aware parser change is intentional. +parsed: + title: "Der.Tatortreiniger.S01-06" + year: null + season: null + episode: null + quality: "1080p" + source: "WEB" + codec: "x264" + group: "WAYNE" + tech_string: "1080p.WEB.x264" + media_type: "movie" + languages: ["GERMAN"] + parse_path: "direct" + is_season_pack: false + +tree: + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E02.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S02E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S06E08.GERMAN.1080p.WEB.x264-WAYNE.mkv" + +routing: + library: + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E02.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S02E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S06E08.GERMAN.1080p.WEB.x264-WAYNE.mkv" + torrents: + - "Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/" + seed_hardlinks: + - source: "library/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + target: "torrents/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - source: "library/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E02.GERMAN.1080p.WEB.x264-WAYNE.mkv" + target: "torrents/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S01E02.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - source: "library/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S02E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + target: "torrents/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S02E01.GERMAN.1080p.WEB.x264-WAYNE.mkv" + - source: "library/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S06E08.GERMAN.1080p.WEB.x264-WAYNE.mkv" + target: "torrents/Der.Tatortreiniger.S01-06.GERMAN.1080p.WEB.x264-WAYNE/Der.Tatortreiniger.S06E08.GERMAN.1080p.WEB.x264-WAYNE.mkv" diff --git a/tests/fixtures/releases/shitty/vinyl_1x01_format/expected.yaml b/tests/fixtures/releases/shitty/vinyl_1x01_format/expected.yaml new file mode 100644 index 0000000..988552c --- /dev/null +++ b/tests/fixtures/releases/shitty/vinyl_1x01_format/expected.yaml @@ -0,0 +1,32 @@ +release_name: "Vinyl - 1x01 - FHD" + +# Tech debt: surrounding ' - ' separators leave a stray '-' token attached +# to the title ("Vinyl.-"). NxNN form correctly identifies S01E01; everything +# tech-side empty (no quality token in KB — "FHD" not yet known). Anti-regression +# the current degenerate title so a future fix is intentional. +parsed: + title: "Vinyl.-" + year: null + season: 1 + episode: 1 + quality: null + source: null + codec: null + group: "UNKNOWN" + tech_string: "" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: false + +tree: + - "Vinyl - 1x01 - FHD/" + - "Vinyl - 1x01 - FHD/Vinyl - 1x01 - FHD.mkv" + +routing: + library: + - "Vinyl - 1x01 - FHD/Vinyl - 1x01 - FHD.mkv" + torrents: + - "Vinyl - 1x01 - FHD/" + seed_hardlinks: + - source: "library/Vinyl - 1x01 - FHD/Vinyl - 1x01 - FHD.mkv" + target: "torrents/Vinyl - 1x01 - FHD/Vinyl - 1x01 - FHD.mkv" diff --git a/tests/fixtures/releases/shitty/westworld_subs_only/expected.yaml b/tests/fixtures/releases/shitty/westworld_subs_only/expected.yaml new file mode 100644 index 0000000..ce257d5 --- /dev/null +++ b/tests/fixtures/releases/shitty/westworld_subs_only/expected.yaml @@ -0,0 +1,46 @@ +release_name: "Westworld.S04.Subs.Only" + +# Subtitle-only release (no video). Parser still classifies as TV S04 from +# the S04 marker. Organiser will need to detect "no video file" and route +# everything subtitle-side — this fixture's tree captures that shape. +parsed: + title: "Westworld" + year: null + season: 4 + episode: null + quality: null + source: null + codec: null + group: "UNKNOWN" + tech_string: "" + media_type: "tv_show" + parse_path: "direct" + is_season_pack: true + +tree: + - "Westworld.S04.Subs.Only/" + - "Westworld.S04.Subs.Only/Westworld.S04E01.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E02.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E03.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E04.fre.srt" + +# No video to library — all sidecars travel together. Will likely require a +# distinct flow in organize_media: subs join an *existing* show in library +# without dragging a video. +routing: + library: + - "Westworld.S04.Subs.Only/Westworld.S04E01.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E02.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E03.fre.srt" + - "Westworld.S04.Subs.Only/Westworld.S04E04.fre.srt" + torrents: + - "Westworld.S04.Subs.Only/" + seed_hardlinks: + - source: "library/Westworld.S04.Subs.Only/Westworld.S04E01.fre.srt" + target: "torrents/Westworld.S04.Subs.Only/Westworld.S04E01.fre.srt" + - source: "library/Westworld.S04.Subs.Only/Westworld.S04E02.fre.srt" + target: "torrents/Westworld.S04.Subs.Only/Westworld.S04E02.fre.srt" + - source: "library/Westworld.S04.Subs.Only/Westworld.S04E03.fre.srt" + target: "torrents/Westworld.S04.Subs.Only/Westworld.S04E03.fre.srt" + - source: "library/Westworld.S04.Subs.Only/Westworld.S04E04.fre.srt" + target: "torrents/Westworld.S04.Subs.Only/Westworld.S04E04.fre.srt"