feat: mix mood radio by seed percentage and embed download artwork
Moods now store a seedPercent (0-100, default 50). RadioService rolls that share independently for every queued slot: heads picks from the seed songs, tails from the generated recommendation pool. When one pool is empty the other fills the batch, so a mood never stalls. The DTO exposes both seedPercent and the derived recommendationPercent, and create/patch accept seedPercent. Automatic YT downloads now embed the video thumbnail as MP3 cover art so the scanner publishes a cover for newly imported tracks. V7 adds moods.seed_percent.
This commit is contained in:
1 parent
dd7bbde84d
commit
c75f2971b4
11 files changed
+146
-6
No files matched your search
@@ -99,6 +99,8 @@ data class MoodDto(
|
||||
val query: String? = null,
|
||||
val genres: List<String> = emptyList(),
|
||||
val targetSize: Int,
|
||||
val seedPercent: Int,
|
||||
val recommendationPercent: Int,
|
||||
val refreshHours: Int,
|
||||
val ytEnabled: Boolean,
|
||||
val lastDiscoveryAt: String? = null,
|
||||
@@ -116,6 +118,8 @@ fun MoodRecord.toDto(): MoodDto = MoodDto(
|
||||
query = query,
|
||||
genres = genres,
|
||||
targetSize = targetSize,
|
||||
seedPercent = seedPercent,
|
||||
recommendationPercent = 100 - seedPercent,
|
||||
refreshHours = refreshHours,
|
||||
ytEnabled = ytEnabled,
|
||||
lastDiscoveryAt = lastDiscoveryAt,
|
||||
@@ -150,6 +154,8 @@ data class CreateMoodRequest(
|
||||
val refreshHours: Int = 24,
|
||||
val ytEnabled: Boolean = true,
|
||||
val seedSongIds: List<String> = emptyList(),
|
||||
/** Share of each batch that comes from the seed songs; the rest is recommended. */
|
||||
val seedPercent: Int = 50,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -163,6 +169,7 @@ data class UpdateMoodRequest(
|
||||
val targetSize: Int? = null,
|
||||
val refreshHours: Int? = null,
|
||||
val ytEnabled: Boolean? = null,
|
||||
val seedPercent: Int? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
||||
Reference in new issue
Block a user