feat: now-playing polling from Record API with station mapping and WebSocket broadcast

This commit is contained in:
nk
2026-06-02 19:31:48 +03:00
parent 2ae682fb68
commit 7823b17d55
4 changed files with 219 additions and 15 deletions

View File

@@ -35,20 +35,21 @@ model MagicLinkToken {
}
model Station {
id String @id @default(cuid())
stationId Int @unique @map("station_id")
name String
prefix String
streamUrl String @map("stream_url")
coverUrl String? @map("cover_url")
genre String?
tags String[]
sortOrder Int @map("sort_order")
source String // "record" | "local"
isOnline Boolean @default(true) @map("is_online")
lastCheckAt DateTime? @map("last_check_at")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
id String @id @default(cuid())
stationId Int @unique @map("station_id")
name String
prefix String
streamUrl String @map("stream_url")
coverUrl String? @map("cover_url")
genre String?
tags String[]
sortOrder Int @map("sort_order")
source String @default("local") // "record" | "local"
isOnline Boolean @default(true) @map("is_online")
lastCheckAt DateTime? @map("last_check_at")
recordStationId Int? @unique @map("record_station_id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
favorites UserFavorite[]
history PlayHistory[]
@@ -56,6 +57,7 @@ model Station {
@@index([isOnline])
@@index([source])
@@index([recordStationId])
@@map("stations")
}