Fix crash when albums are browsing in offline mode
This commit is contained in:
parent
5e449ab7dc
commit
f6a7b97e47
1 changed files with 4 additions and 2 deletions
|
@ -38,8 +38,10 @@ class AlbumDetailsViewModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadAlbumInfo(album: Album) = viewModelScope.launch(Dispatchers.IO) {
|
fun loadAlbumInfo(album: Album) = viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
try {
|
||||||
val lastFmAlbum = _repository.albumInfo(album.artistName ?: "-", album.title ?: "-")
|
val lastFmAlbum = _repository.albumInfo(album.artistName ?: "-", album.title ?: "-")
|
||||||
_lastFmAlbum.postValue(lastFmAlbum)
|
_lastFmAlbum.postValue(lastFmAlbum)
|
||||||
|
} catch (ignored: Exception) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadArtist(artistId: Int) = viewModelScope.launch(Dispatchers.IO) {
|
fun loadArtist(artistId: Int) = viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue