Files
mcma-backend/app/domain/entities/track.py
T
Senko-san 5c5df5d3cc feat(storage): S3-compatible storage adapter + storage_uri rename
Add S3FileStorage adapter (any S3-compatible backend: AWS, MinIO, Garage)
alongside the local adapter, selected via STORAGE_BACKEND. Proxied range
streaming via get_object+Range; as_local_path downloads to a tempfile for
ffmpeg/fpcalc. Rename track.file_path -> storage_uri across domain entity,
ORM, repositories, port, and services, with an Alembic migration. Adds
mocked S3 unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:11:35 +03:00

33 lines
642 B
Python

"""Track and Artist domain entities."""
import datetime as dt
import uuid
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class Artist:
id: uuid.UUID
name: str
created_at: dt.datetime
updated_at: dt.datetime
@dataclass(frozen=True, slots=True)
class Track:
id: uuid.UUID
title: str
artist_id: uuid.UUID
album_id: uuid.UUID | None
storage_uri: str
file_format: str
file_size: int
source: str
source_id: str
duration_seconds: int | None
genre: str | None
year: int | None
metadata_status: str
created_at: dt.datetime
updated_at: dt.datetime