refactor(domain): Phase 3 — TVShow/Movie aggregates become TMDB-only
Filesystem-side concerns (file paths, tracks, quality, mode, added_at) move to the releases/ domain added in Phase 1; the TMDB aggregates now carry only identity + TMDB catalog facts. Domain entities: - TVShow: tmdb_id: TmdbId required (primary key), imdb_id: ImdbId | None optional, status: str = "unknown" added. - Season: episode_count: int = 0 added (TMDB-cached); audio_tracks, subtitle_tracks, mode property removed. - Episode: slimmed to identity + title. file_path/file_size/tracks removed. No longer inherits MediaWithTracks. - Movie: tmdb_id required, imdb_id optional. file_path/file_size/quality/ added_at/audio_tracks/subtitle_tracks removed. get_filename() now returns "Title.Year" — quality moves to MovieRelease. Builders: - TVShowBuilder requires tmdb_id: TmdbId; imdb_id/status optional. - SeasonBuilder.set_episode_count(int) replaces set_audio_tracks / set_subtitle_tracks. No-coercion contract: TVShow(tmdb_id=1396) raises — callers pass TmdbId(1396). No ergonomic shim per the no-shims rule. Cascade fixes: - MediaOrganizer test fixtures updated to new Movie/TVShow shapes. - Movie.get_filename() re-added (without Quality) so MediaOrganizer keeps working until Phase 4 rewires it through MovieRelease. Quarantined (deleted in Phase 4 alongside v1 dot_alfred): - tests/application/library/test_rescan.py — module-level skip. - tests/infrastructure/persistence/dot_alfred/test_repository.py — module-level skip. - tests/infrastructure/persistence/dot_alfred/test_serializer.py — module-level skip. Suite: 1216 passed, 11 skipped (8 pre-existing + 3 Phase 3 quarantines), 4 xfailed. CHANGELOG updated under [Unreleased].
This commit is contained in:
@@ -17,8 +17,8 @@ from __future__ import annotations
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from alfred.domain.movies.entities import Movie
|
||||
from alfred.domain.movies.value_objects import MovieTitle, Quality, ReleaseYear
|
||||
from alfred.domain.shared.value_objects import ImdbId
|
||||
from alfred.domain.movies.value_objects import MovieTitle, ReleaseYear
|
||||
from alfred.domain.shared.value_objects import ImdbId, TmdbId
|
||||
from alfred.domain.tv_shows.entities import Episode, TVShow
|
||||
from alfred.domain.tv_shows.value_objects import (
|
||||
EpisodeNumber,
|
||||
@@ -159,17 +159,18 @@ class TestFindVideo:
|
||||
|
||||
def _movie() -> Movie:
|
||||
return Movie(
|
||||
imdb_id=ImdbId("tt1375666"),
|
||||
tmdb_id=TmdbId(27205),
|
||||
title=MovieTitle("Inception"),
|
||||
imdb_id=ImdbId("tt1375666"),
|
||||
release_year=ReleaseYear(2010),
|
||||
quality=Quality.HD,
|
||||
)
|
||||
|
||||
|
||||
def _show() -> TVShow:
|
||||
return TVShow(
|
||||
imdb_id=ImdbId("tt0773262"),
|
||||
tmdb_id=TmdbId(2452),
|
||||
title="Dexter",
|
||||
imdb_id=ImdbId("tt0773262"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user