chore: snapshot current project updates

This commit is contained in:
windyboy
2026-02-13 13:36:39 +08:00
parent 5931f16a71
commit 0be802eac5
74 changed files with 594899 additions and 66082 deletions
+16 -9
View File
@@ -103,13 +103,13 @@ class TestMovieParser:
def test_parse_movie_with_dots_in_title(self):
"""Test parsing movie with dots in title."""
result = parse_movie("The.Lord.of.the.Rings.2001.mkv")
assert result.title == "The Lord Of The Rings"
assert result.title == "The Lord of the Rings"
assert result.year == 2001
def test_parse_movie_with_underscores(self):
"""Test parsing movie with underscores in title."""
result = parse_movie("Star_Wars_Episode_IV (1977).mp4")
assert result.title == "Star Wars Episode Iv"
assert result.title == "Star Wars Episode IV"
assert result.year == 1977
def test_parse_movie_preserves_original_filename(self):
@@ -134,10 +134,10 @@ class TestNormalizeTitle:
"""Test that extra whitespace is removed."""
assert normalize_title("The Matrix Reloaded") == "The Matrix Reloaded"
def test_normalize_applies_title_case(self):
"""Test that title case is applied."""
assert normalize_title("the matrix") == "The Matrix"
assert normalize_title("THE MATRIX") == "The Matrix"
def test_normalize_preserves_case(self):
"""Test that normalization preserves original letter case."""
assert normalize_title("the matrix") == "the matrix"
assert normalize_title("THE MATRIX") == "THE MATRIX"
def test_normalize_idempotence(self):
"""Test that normalizing multiple times produces same result."""
@@ -206,7 +206,7 @@ class TestSeriesParser:
def test_parse_series_sxxeyy_lowercase(self):
"""Test parsing series with lowercase sxxeyy format."""
result = parse_series("Game of Thrones s02e05.mkv")
assert result.title == "Game Of Thrones"
assert result.title == "Game of Thrones"
assert result.season == 2
assert result.episodes == [5]
assert result.confidence == 0.9
@@ -348,6 +348,13 @@ class TestSeriesParser:
assert result.episodes == [15]
assert result.confidence == 0.9
def test_parse_series_resolution_not_treated_as_season_episode(self):
"""1920x1080 should not be parsed as 20x10."""
result = parse_series("Some.Show.1920x1080.BluRay.mkv")
assert result.season is None
assert result.episodes == []
assert result.needs_review is True
class TestEpisodeGrouping:
"""Tests for episode grouping functionality."""
@@ -369,14 +376,14 @@ class TestEpisodeGrouping:
assert len(groups) == 3
assert ("Breaking Bad", 1) in groups
assert ("Breaking Bad", 2) in groups
assert ("Game Of Thrones", 1) in groups
assert ("Game of Thrones", 1) in groups
# Breaking Bad S01 should have 2 episodes
assert len(groups[("Breaking Bad", 1)]) == 2
# Breaking Bad S02 should have 1 episode
assert len(groups[("Breaking Bad", 2)]) == 1
# Game of Thrones S01 should have 1 episode
assert len(groups[("Game Of Thrones", 1)]) == 1
assert len(groups[("Game of Thrones", 1)]) == 1
def test_group_episodes_excludes_none_season(self):
"""Test that episodes with season=None are excluded from grouping."""