package com.radiola.domain.usecase import com.radiola.domain.geo.GeoBlock import com.radiola.domain.model.Station import com.radiola.domain.repository.RegionRepository import com.radiola.domain.repository.StationRepository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import javax.inject.Inject class GetStationsUseCase @Inject constructor( private val stationRepository: StationRepository, private val regionRepository: RegionRepository ) { // Гео-фильтр: для пользователей из РФ убираем недоступные украинские станции // (Radio ROKS, Kiss FM) из всех мест, где используется список станций. operator fun invoke(): Flow> = combine( stationRepository.getStations(), regionRepository.countryCode() ) { stations, country -> stations.filterNot { GeoBlock.isHidden(it, country) } } }