Update RealRepository.kt

This commit is contained in:
Hemanth S 2020-08-13 23:43:32 +05:30
parent 1c08487939
commit 038e872e7a

View file

@ -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)
} }