mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-07-31 09:06:06 -04:00
This PR refactors the movie and tv modules and adds a "common" module for shared logic. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Dedicated import and metadata services for movies and TV; completed-torrent detection and import flows. * **Refactor** * Shared media schemas, models, repository logic and base services consolidated; movie/TV services and routes now delegate to specialised import/metadata services. * **Bug Fixes** * Fixed TV episode-count method name. * **Chores** * Added .DS_Store to ignore list; added module comment. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
34 lines
734 B
Python
34 lines
734 B
Python
import uuid
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from media_manager.torrent.models import Quality
|
|
|
|
|
|
class BaseMedia(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: UUID = Field(default_factory=uuid.uuid4)
|
|
name: str
|
|
overview: str
|
|
year: int | None
|
|
external_id: int
|
|
metadata_provider: str
|
|
library: str = "Default"
|
|
original_language: str | None = None
|
|
imdb_id: str | None = None
|
|
|
|
|
|
class BaseMediaFile(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
quality: Quality
|
|
torrent_id: UUID | None = None
|
|
file_path_suffix: str
|
|
|
|
|
|
class PublicMediaFile(BaseMediaFile):
|
|
downloaded: bool = False
|
|
imported: bool = False
|