Update RealRepository.kt
This commit is contained in:
parent
1c08487939
commit
038e872e7a
1 changed files with 5 additions and 7 deletions
|
@ -74,6 +74,8 @@ interface Repository {
|
||||||
|
|
||||||
suspend fun genresHome(): Home
|
suspend fun genresHome(): Home
|
||||||
|
|
||||||
|
suspend fun playlists(): Home
|
||||||
|
|
||||||
suspend fun homeSections(): List<Home>
|
suspend fun homeSections(): List<Home>
|
||||||
|
|
||||||
suspend fun homeSectionsFlow(): Flow<Result<List<Home>>>
|
suspend fun homeSectionsFlow(): Flow<Result<List<Home>>>
|
||||||
|
@ -189,8 +191,7 @@ class RealRepository(
|
||||||
recentArtistsHome(),
|
recentArtistsHome(),
|
||||||
recentAlbumsHome(),
|
recentAlbumsHome(),
|
||||||
suggestionsHome(),
|
suggestionsHome(),
|
||||||
favoritePlaylistHome(),
|
favoritePlaylistHome()
|
||||||
genresHome()
|
|
||||||
)
|
)
|
||||||
for (section in sections) {
|
for (section in sections) {
|
||||||
if (section.arrayList.isNotEmpty()) {
|
if (section.arrayList.isNotEmpty()) {
|
||||||
|
@ -201,12 +202,12 @@ class RealRepository(
|
||||||
return homeSections
|
return homeSections
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun playlists(): Home {
|
override suspend fun playlists(): Home {
|
||||||
val playlist = playlistRepository.playlists()
|
val playlist = playlistRepository.playlists()
|
||||||
return Home(playlist, TOP_ALBUMS)
|
return Home(playlist, TOP_ALBUMS)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun playlists(playlistId: Int) =
|
override suspend fun playlist(playlistId: Int) =
|
||||||
playlistRepository.playlist(playlistId)
|
playlistRepository.playlist(playlistId)
|
||||||
|
|
||||||
override suspend fun suggestionsHome(): Home {
|
override suspend fun suggestionsHome(): Home {
|
||||||
|
@ -303,7 +304,4 @@ class RealRepository(
|
||||||
emit(Result.Success(data))
|
emit(Result.Success(data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun playlist(playlistId: Int): Playlist =
|
|
||||||
playlistRepository.playlist(playlistId)
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue