feat: M3 weighted shuffle v1 — real /api/radio with scoring #21

Merged
bvandeusen merged 262 commits from dev into main 2026-04-27 11:00:29 -04:00
4 changed files with 40 additions and 35 deletions
Showing only changes of commit fe878a392c - Show all commits
@@ -0,0 +1,22 @@
package com.fabledsword.minstrel.models.wire
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Wire shape for `GET /api/albums/{id}` — server returns AlbumRef
* fields PLUS an embedded `tracks` array.
*/
@Serializable
data class AlbumDetailWire(
val id: String,
val title: String,
@SerialName("artist_id") val artistId: String,
@SerialName("sort_title") val sortTitle: String = "",
@SerialName("artist_name") val artistName: String = "",
val year: Int? = null,
@SerialName("track_count") val trackCount: Int = 0,
@SerialName("duration_sec") val durationSec: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
val tracks: List<TrackWire> = emptyList(),
)
@@ -18,21 +18,3 @@ data class AlbumWire(
@SerialName("duration_sec") val durationSec: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
)
/**
* Wire shape for `GET /api/albums/{id}` — server returns AlbumRef
* fields PLUS an embedded `tracks` array.
*/
@Serializable
data class AlbumDetailWire(
val id: String,
val title: String,
@SerialName("artist_id") val artistId: String,
@SerialName("sort_title") val sortTitle: String = "",
@SerialName("artist_name") val artistName: String = "",
val year: Int? = null,
@SerialName("track_count") val trackCount: Int = 0,
@SerialName("duration_sec") val durationSec: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
val tracks: List<TrackWire> = emptyList(),
)
@@ -0,0 +1,18 @@
package com.fabledsword.minstrel.models.wire
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Wire shape for `GET /api/artists/{id}` — server returns ArtistRef
* fields PLUS an embedded `albums` array.
*/
@Serializable
data class ArtistDetailWire(
val id: String,
val name: String,
@SerialName("sort_name") val sortName: String = "",
@SerialName("album_count") val albumCount: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
val albums: List<AlbumWire> = emptyList(),
)
@@ -14,20 +14,3 @@ data class ArtistWire(
@SerialName("album_count") val albumCount: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
)
/**
* Wire shape for `GET /api/artists/{id}` — server returns ArtistRef
* fields PLUS an embedded `albums` array. We can't directly map this
* to ArtistWire because Retrofit/kotlinx.serialization doesn't support
* a single record being two types; an explicit DetailWire spells out
* both halves and the repository handles the split.
*/
@Serializable
data class ArtistDetailWire(
val id: String,
val name: String,
@SerialName("sort_name") val sortName: String = "",
@SerialName("album_count") val albumCount: Int = 0,
@SerialName("cover_url") val coverUrl: String = "",
val albums: List<AlbumWire> = emptyList(),
)