Code refactor

This commit is contained in:
Hemanth S 2020-09-05 19:33:12 +05:30
parent ffa0749849
commit 061b9c90ab
24 changed files with 108 additions and 126 deletions

View file

@ -45,7 +45,7 @@ object GenreMenuHelper : KoinComponent {
}
R.id.action_add_to_playlist -> {
CoroutineScope(Dispatchers.IO).launch {
val playlists = get<RealRepository>().roomPlaylists()
val playlists = get<RealRepository>().fetchPlaylists()
withContext(Dispatchers.Main) {
AddToRetroPlaylist.create(playlists, getGenreSongs(genre))
.show(activity.supportFragmentManager, "ADD_PLAYLIST")

View file

@ -58,7 +58,7 @@ object PlaylistMenuHelper : KoinComponent {
}
R.id.action_add_to_playlist -> {
CoroutineScope(Dispatchers.IO).launch {
val playlists = get<RealRepository>().roomPlaylists()
val playlists = get<RealRepository>().fetchPlaylists()
withContext(Dispatchers.Main) {
AddToRetroPlaylist.create(playlists, playlistWithSongs.songs.toSongs())
.show(activity.supportFragmentManager, "ADD_PLAYLIST")

View file

@ -71,7 +71,7 @@ object SongMenuHelper : KoinComponent {
}
R.id.action_add_to_playlist -> {
CoroutineScope(Dispatchers.IO).launch {
val playlists = get<RealRepository>().roomPlaylists()
val playlists = get<RealRepository>().fetchPlaylists()
withContext(Dispatchers.Main) {
AddToRetroPlaylist.create(playlists, song)
.show(activity.supportFragmentManager, "ADD_PLAYLIST")

View file

@ -45,7 +45,7 @@ object SongsMenuHelper : KoinComponent {
}
R.id.action_add_to_playlist -> {
CoroutineScope(Dispatchers.IO).launch {
val playlists = get<RealRepository>().roomPlaylists()
val playlists = get<RealRepository>().fetchPlaylists()
withContext(Dispatchers.Main) {
AddToRetroPlaylist.create(playlists, songs)
.show(activity.supportFragmentManager, "ADD_PLAYLIST")