fix(player): now-playing с нашего бэкенда вместо сырого Record-эндпоинта
Record /stations/now использует id now-слотов, не совпадающие с id каталога, поэтому клиент не находил трек по station.id (трек/обложка не показывались). Теперь берём GET /now-playing с нашего бэка (корректный маппинг recordSync, ключ = id станции) -> плеер показывает название трека и обложку.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.radiola.data.remote
|
||||
|
||||
import com.radiola.data.remote.dto.AuthResponseDto
|
||||
import com.radiola.data.remote.dto.BackendNowPlayingDto
|
||||
import com.radiola.data.remote.dto.BackendStationDto
|
||||
import com.radiola.data.remote.dto.ChartsResponseDto
|
||||
import com.radiola.data.remote.dto.HistoryResponseDto
|
||||
@@ -25,6 +26,9 @@ interface RadiolaApi {
|
||||
@POST("auth/verify")
|
||||
suspend fun verifyMagicLink(@Body dto: MagicLinkVerifyDto): AuthResponseDto
|
||||
|
||||
@GET("now-playing")
|
||||
suspend fun getNowPlaying(): List<BackendNowPlayingDto>
|
||||
|
||||
@GET("users/me")
|
||||
suspend fun getMe(): JsonObject
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.radiola.data.remote.dto
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
// Текущий трек станции с нашего бэкенда (ключ — числовой id станции каталога).
|
||||
@Serializable
|
||||
data class BackendNowPlayingDto(
|
||||
@SerialName("stationId") val stationId: Int,
|
||||
@SerialName("song") val song: String,
|
||||
@SerialName("artist") val artist: String,
|
||||
@SerialName("coverUrl") val coverUrl: String? = null
|
||||
)
|
||||
Reference in New Issue
Block a user