Adds a --init mode that seeds the database with past shows from a given anchor episode/date forward, batch-fetching likes from SoundCloud and partitioning them into weekly buckets. Episode numbers are tracked in the shows table and auto-incremented by the poller for new shows. Includes full API documentation (docs/api.md) and updated README. Made-with: Cursor
32 lines
533 B
Python
32 lines
533 B
Python
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Track:
|
|
id: int
|
|
title: str
|
|
artist: str
|
|
permalink_url: str
|
|
artwork_url: str | None
|
|
duration_ms: int
|
|
license: str
|
|
liked_at: datetime
|
|
raw_json: str
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Show:
|
|
id: int
|
|
week_start: datetime
|
|
week_end: datetime
|
|
created_at: datetime
|
|
episode_number: int | None = None
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ShowTrack:
|
|
show_id: int
|
|
track_id: int
|
|
position: int
|