feat(domain): add repository interfaces
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
package com.radiola.domain.repository
|
||||||
|
|
||||||
|
import com.radiola.domain.model.Station
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
interface FavoritesRepository {
|
||||||
|
fun getFavorites(): Flow<List<Station>>
|
||||||
|
suspend fun addFavorite(station: Station)
|
||||||
|
suspend fun removeFavorite(stationId: Int)
|
||||||
|
fun isFavorite(stationId: Int): Flow<Boolean>
|
||||||
|
suspend fun reorderFavorites(orderedIds: List<Int>)
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.radiola.domain.repository
|
||||||
|
|
||||||
|
import com.radiola.domain.model.Track
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
interface NowPlayingRepository {
|
||||||
|
fun getNowPlaying(stationPrefix: String): Flow<Track?>
|
||||||
|
fun getAllNowPlaying(): Flow<Map<String, Track>>
|
||||||
|
suspend fun refreshNowPlaying(): Result<Unit>
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.radiola.domain.repository
|
||||||
|
|
||||||
|
import com.radiola.domain.model.DeeplinkService
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
interface SettingsRepository {
|
||||||
|
fun getLastStationId(): Flow<Int?>
|
||||||
|
suspend fun setLastStationId(id: Int)
|
||||||
|
fun getSleepTimerMinutes(): Flow<Int>
|
||||||
|
suspend fun setSleepTimerMinutes(minutes: Int)
|
||||||
|
fun getEnabledDeeplinkServices(): Flow<Set<String>>
|
||||||
|
suspend fun setEnabledDeeplinkServices(serviceIds: Set<String>)
|
||||||
|
fun getEqualizerPreset(): Flow<String>
|
||||||
|
suspend fun setEqualizerPreset(preset: String)
|
||||||
|
fun isRecordingEnabled(): Flow<Boolean>
|
||||||
|
suspend fun setRecordingEnabled(enabled: Boolean)
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.radiola.domain.repository
|
||||||
|
|
||||||
|
import com.radiola.domain.model.Station
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
interface StationRepository {
|
||||||
|
fun getStations(): Flow<List<Station>>
|
||||||
|
suspend fun refreshStations(): Result<Unit>
|
||||||
|
fun getStationById(id: Int): Flow<Station?>
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.radiola.domain.repository
|
||||||
|
|
||||||
|
import com.radiola.domain.model.Track
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
interface TrackHistoryRepository {
|
||||||
|
fun getHistory(): Flow<List<Track>>
|
||||||
|
suspend fun addTrack(track: Track)
|
||||||
|
suspend fun removeTrack(track: Track)
|
||||||
|
suspend fun searchHistory(query: String): List<Track>
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user