feat(charts): фильтр по жанру + жанр/стиль/лейбл/год на детальной трека
Подтягиваем обогащённые данные с бэкенда (Discogs): genre/styles/label/year в чартах и детальной странице. - ChartEntry/TrackStats + DTO: добавлены genre/styles/label/year - RadiolaApi: getCharts(?genre=), новый getGenres() - ChartsViewModel: состояние выбранного жанра + список жанров, перезагрузка - ChartsScreen: ряд чипов-фильтров по жанру (Все + жанры), жанр/стили чипами и «Лейбл · Год» на детальной - убран демо-fallback (SAMPLE_CHARTS) — бэкенд живой Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ 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.GenresResponseDto
|
||||
import com.radiola.data.remote.dto.HistoryResponseDto
|
||||
import com.radiola.data.remote.dto.MagicLinkRequestDto
|
||||
import com.radiola.data.remote.dto.MagicLinkVerifyDto
|
||||
@@ -58,9 +59,13 @@ interface RadiolaApi {
|
||||
@GET("charts/tracks")
|
||||
suspend fun getCharts(
|
||||
@Query("period") period: String,
|
||||
@Query("limit") limit: Int = 100
|
||||
@Query("limit") limit: Int = 100,
|
||||
@Query("genre") genre: String? = null
|
||||
): ChartsResponseDto
|
||||
|
||||
@GET("charts/genres")
|
||||
suspend fun getGenres(): GenresResponseDto
|
||||
|
||||
@GET("charts/tracks/{trackId}")
|
||||
suspend fun getTrackStats(@Path("trackId") trackId: String): TrackStatsDto
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ data class ChartsResponseDto(
|
||||
val items: List<ChartEntryDto> = emptyList()
|
||||
)
|
||||
|
||||
/** DTO списка доступных жанров для фильтра. */
|
||||
@Serializable
|
||||
data class GenresResponseDto(
|
||||
val genres: List<String> = emptyList()
|
||||
)
|
||||
|
||||
/** Одна позиция в чарте. */
|
||||
@Serializable
|
||||
data class ChartEntryDto(
|
||||
@@ -16,6 +22,10 @@ data class ChartEntryDto(
|
||||
val artist: String,
|
||||
val song: String,
|
||||
val coverUrl: String? = null,
|
||||
val genre: String? = null,
|
||||
val styles: List<String> = emptyList(),
|
||||
val label: String? = null,
|
||||
val year: Int? = null,
|
||||
val plays: Int = 0,
|
||||
val stationsCount: Int = 0,
|
||||
val likes: Int = 0,
|
||||
@@ -32,6 +42,10 @@ data class TrackStatsDto(
|
||||
val song: String,
|
||||
val album: String? = null,
|
||||
val coverUrl: String? = null,
|
||||
val genre: String? = null,
|
||||
val styles: List<String> = emptyList(),
|
||||
val label: String? = null,
|
||||
val year: Int? = null,
|
||||
val releaseDate: String? = null,
|
||||
val firstSeen: String? = null,
|
||||
val totalPlays: Int = 0,
|
||||
|
||||
Reference in New Issue
Block a user