Code refactor
This commit is contained in:
parent
ffa0749849
commit
061b9c90ab
24 changed files with 108 additions and 126 deletions
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue