feat: auth screen with auto-redirect, sync favorites/history with backend
This commit is contained in:
@@ -8,25 +8,26 @@ import com.radiola.domain.model.Track
|
||||
object ApiMapper {
|
||||
|
||||
fun StationDto.toDomain(): Station {
|
||||
val cover = iconPng ?: iconSvg ?: ""
|
||||
val cover = iconFillColored ?: bgImageMobile ?: bgImage ?: ""
|
||||
val stream = stream128 ?: stream320 ?: streamHls ?: "https://air.radiorecord.ru:805/${prefix}_128"
|
||||
return Station(
|
||||
id = id,
|
||||
name = name,
|
||||
prefix = prefix,
|
||||
streamUrl = "https://air.radiorecord.ru:805/${prefix}_128",
|
||||
streamUrl = stream,
|
||||
coverUrl = cover,
|
||||
genre = genre ?: "",
|
||||
tags = emptyList(),
|
||||
sortOrder = id
|
||||
genre = tooltip ?: "",
|
||||
tags = tags.map { it.name },
|
||||
sortOrder = sort
|
||||
)
|
||||
}
|
||||
|
||||
fun NowPlayingItemDto.toDomain(): Track {
|
||||
return Track(
|
||||
artist = artist,
|
||||
song = song,
|
||||
coverUrl = image600 ?: image100,
|
||||
stationName = prefix
|
||||
artist = track.artist,
|
||||
song = track.song,
|
||||
coverUrl = track.image600 ?: track.image100,
|
||||
stationName = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user