feat(stations): убран чип «Новый год» (межсезонный тег Record)
Christmas Chill и др. остаются в разделе Radio Record (genre=Radio Record), просто скрыт сам тег-чип через hiddenTags. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,10 @@ class StationRepositoryImpl @Inject constructor(
|
|||||||
|
|
||||||
private val _tags = MutableStateFlow<List<String>>(emptyList())
|
private val _tags = MutableStateFlow<List<String>>(emptyList())
|
||||||
|
|
||||||
|
// Теги-чипы, которые не показываем (сезонные/мусорные). «Новый год» —
|
||||||
|
// межсезонный тег Record (Christmas Chill и т.п. остаются в разделе Radio Record).
|
||||||
|
private val hiddenTags = setOf("Новый год")
|
||||||
|
|
||||||
override fun getStations(): Flow<List<Station>> {
|
override fun getStations(): Flow<List<Station>> {
|
||||||
return db.stationDao().getAll().map { entities ->
|
return db.stationDao().getAll().map { entities ->
|
||||||
entities.map { it.toDomain() }
|
entities.map { it.toDomain() }
|
||||||
@@ -108,7 +112,9 @@ class StationRepositoryImpl @Inject constructor(
|
|||||||
|
|
||||||
// 5. Update tags: group names + API tags
|
// 5. Update tags: group names + API tags
|
||||||
val groupNames = localGroups.map { it.name }.filter { it.isNotBlank() }
|
val groupNames = localGroups.map { it.name }.filter { it.isNotBlank() }
|
||||||
val allTags = (groupNames + apiTags).distinct().sorted()
|
val allTags = (groupNames + apiTags).distinct()
|
||||||
|
.filterNot { it in hiddenTags }
|
||||||
|
.sorted()
|
||||||
db.tagDao().clearAll()
|
db.tagDao().clearAll()
|
||||||
db.tagDao().insertAll(allTags.map { TagEntity(it) })
|
db.tagDao().insertAll(allTags.map { TagEntity(it) })
|
||||||
_tags.value = allTags
|
_tags.value = allTags
|
||||||
|
|||||||
Reference in New Issue
Block a user