fa23568214
Implement `GET /api/v1/storage`, replacing the stub. Returns aggregate library facts (track/artist/album counts, total footprint, playtime, per-format / per-source / metadata-status breakdowns, top genres) plus the real capacity of the backing volume. - domain: `LibraryStats`, `FormatBreakdown`, `DiskUsage` value objects - ports: `FileStorage.disk_usage()` (local = shutil.disk_usage walking up to the nearest existing ancestor; S3 returns None — no fixed disk) - repo: `TrackRepository.library_stats()` (single set of GROUP BYs) - tests: storage stats API (auth, empty library, upload counting) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
946 B
Python
37 lines
946 B
Python
"""Domain entities and value objects — pure, framework-free."""
|
|
|
|
from app.domain.entities.album import Album
|
|
from app.domain.entities.cover import CoverArt
|
|
from app.domain.entities.history import PlayHistoryEntry
|
|
from app.domain.entities.like import Like
|
|
from app.domain.entities.metadata import AudioTags, Fingerprint, RecordingMatch
|
|
from app.domain.entities.playlist import Playlist
|
|
from app.domain.entities.storage import (
|
|
DiskUsage,
|
|
FormatBreakdown,
|
|
LibraryStats,
|
|
ObjectStat,
|
|
)
|
|
from app.domain.entities.track import Artist, Track
|
|
from app.domain.entities.user import Credentials, SubsonicCredentials, User
|
|
|
|
__all__ = [
|
|
"Album",
|
|
"Artist",
|
|
"AudioTags",
|
|
"CoverArt",
|
|
"Credentials",
|
|
"DiskUsage",
|
|
"Fingerprint",
|
|
"FormatBreakdown",
|
|
"LibraryStats",
|
|
"Like",
|
|
"ObjectStat",
|
|
"PlayHistoryEntry",
|
|
"Playlist",
|
|
"RecordingMatch",
|
|
"SubsonicCredentials",
|
|
"Track",
|
|
"User",
|
|
]
|