Minimum working prototype
This commit is contained in:
parent
c3ddb066b7
commit
76e55ba079
6 changed files with 33 additions and 4 deletions
|
@ -13,6 +13,7 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
|||
import code.name.monkey.retromusic.interfaces.MusicServiceEventListener
|
||||
import code.name.monkey.retromusic.model.*
|
||||
import code.name.monkey.retromusic.repository.RealRepository
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
@ -91,8 +92,14 @@ class LibraryViewModel(
|
|||
}
|
||||
|
||||
private fun fetchArtists() {
|
||||
viewModelScope.launch(IO) {
|
||||
artists.postValue(repository.fetchArtists())
|
||||
if (PreferenceUtil.albumArtistsOnly) {
|
||||
viewModelScope.launch(IO) {
|
||||
artists.postValue(repository.albumArtists())
|
||||
}
|
||||
} else {
|
||||
viewModelScope.launch(IO) {
|
||||
artists.postValue(repository.fetchArtists())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue