Skip to content

Commit

Permalink
fix: saga in title for a couple shows/movies
Browse files Browse the repository at this point in the history
  • Loading branch information
dreulavelle committed Sep 1, 2024
1 parent c27f952 commit 97c57e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion PTT/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ def handle_volumes(context):
parser.add_handler("complete", regex.compile(r"(?:\bthe\W)?\bultimate\b[ .]\bcollection\b", regex.IGNORECASE), boolean, {"skipIfAlreadyFound": False})
parser.add_handler("complete", regex.compile(r"\bcollection\b.*\b(?:set|pack|movies)\b", regex.IGNORECASE), boolean)
parser.add_handler("complete", regex.compile(r"\bcollection\b", regex.IGNORECASE), boolean, {"skipFromTitle": True})
parser.add_handler("complete", regex.compile(r"duology|trilogy|quadr[oi]logy|tetralogy|pentalogy|hexalogy|heptalogy|anthology|saga", regex.IGNORECASE), boolean, {"skipIfAlreadyFound": False})
parser.add_handler("complete", regex.compile(r"duology|trilogy|quadr[oi]logy|tetralogy|pentalogy|hexalogy|heptalogy|anthology", regex.IGNORECASE), boolean, {"skipIfAlreadyFound": False})
parser.add_handler("complete", regex.compile(r"\bcompleta\b", regex.IGNORECASE), boolean, {"remove": True})
parser.add_handler("complete", regex.compile(r"\bsaga\b", regex.IGNORECASE), boolean, {"skipFromTitle": True, "skipIfAlreadyFound": True})

# Seasons
parser.add_handler("seasons", regex.compile(r"(?:complete\W|seasons?\W|\W|^)((?:s\d{1,2}[., +/\\&-]+)+s\d{1,2}\b)", regex.IGNORECASE), range_func, {"remove": True})
Expand Down
6 changes: 4 additions & 2 deletions tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def parser():
("[Furi] Avatar - The Last Airbender [720p] (Full 3 Seasons + Extr", True, None),
("Harry.Potter.Complete.Collection.2001-2011.1080p.BluRay.DTS-ETRG", True, None),
("Game of Thrones All 7 Seasons 1080p ~∞~ .HakunaMaKoko", True, None),
("Avatar: The Last Airbender Full Series 720p", True, None),
("Avatar: The Last Airbender Full Series 720p", True, "Avatar: The Last Airbender"),
("Dora the Explorer - Ultimate Collection", True, None),
("Mr Bean Complete Pack (Animated, Tv series, 2 Movies) DVDRIP (WA", True, None),
("American Pie - Complete set (8 movies) 720p mkv - YIFY", True, None),
Expand All @@ -33,11 +33,13 @@ def parser():
("X-Men.Tetralogy.BRRip.XviD.AC3.RoSubbed-playXD", True, None),
("Mission.Impossible.Pentalogy.1996-2015.1080p.BluRay.x264.AAC.5.1", True, None),
("Mission.Impossible.Hexalogy.1996-2018.SweSub.1080p.x264-Justiso", True, None),
("American.Pie.Heptalogy.SWESUB.DVDRip.XviD-BaZZe", True, None),
("American.Pie.Heptalogy.SWESUB.DVDRip.XviD-BaZZe", True, "American Pie"),
("The Exorcist 1, 2, 3, 4, 5 - Complete Horror Anthology 1973-2005", True, None),
("Harry.Potter.Complete.Saga. I - VIII .1080p.Bluray.x264.anoXmous", True, None),
# This last test ensures that the collection is recognized but also retains the title appropriately.
("[Erai-raws] Ninja Collection - 05 [720p][Multiple Subtitle].mkv", True, "Ninja Collection"),
("Furiosa - A Mad Max Saga (2024) 2160p H265 HDR10 D V iTA EnG AC3 5 1 Sub iTA EnG NUiTA NUEnG AsPiDe-MIRCrew mkv", True, "Furiosa - A Mad Max Saga"),
("[Judas] Vinland Saga (Season 2) [1080p][HEVC x265 10bit][Multi-Subs]", True, "Vinland Saga"),
])
def test_complete_collection_detection(parser, release_name, expected_complete, expected_title):
result = parser.parse(release_name)
Expand Down
13 changes: 5 additions & 8 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,15 +898,12 @@ def test_random_releases_parse(parser, release_name, expected):
assert parser.parse(release_name) == expected

@pytest.mark.parametrize("release_name, expected", [
("Game of Thrones 1ª a 8ª Temporada Completa [720p-1080p] [BluRay] [DUAL]", {
"title": "Game of Thrones",
"seasons": [1, 2, 3, 4, 5, 6, 7, 8],
("(500) Days of Summer (2009)", {
"title": "500 Days of Summer",
"year": 2009,
"seasons": [],
"episodes": [],
"languages": ["es"],
"resolution": "1080p",
"quality": "BluRay",
"complete": True,
"dubbed": True
"languages": []
})
])
def test_debug_releases_parse(parser, release_name, expected):
Expand Down

0 comments on commit 97c57e7

Please sign in to comment.