File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/src/main/java/io/github/muntashirakon/music/activities/albums Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import kotlinx.coroutines.Deferred
1313import kotlinx.coroutines.Dispatchers
1414import kotlinx.coroutines.async
1515import kotlinx.coroutines.launch
16+ import java.lang.Exception
1617
1718class AlbumDetailsViewModel (
1819 private val repository : RepositoryImpl ,
@@ -37,8 +38,12 @@ class AlbumDetailsViewModel(
3738 }
3839
3940 fun loadAlbumInfo (album : Album ) = viewModelScope.launch(Dispatchers .IO ) {
40- val lastFmAlbum = repository.albumInfo(album.artistName ? : " -" , album.title ? : " -" )
41- _lastFmAlbum .postValue(lastFmAlbum)
41+ try {
42+ val lastFmAlbum = repository.albumInfo(
43+ album.artistName ? : " -" , album.title ? : " -"
44+ )
45+ _lastFmAlbum .postValue(lastFmAlbum)
46+ } catch (ignored: Exception ) {}
4247 }
4348
4449 fun loadArtist (artistId : Int ) = viewModelScope.launch(Dispatchers .IO ) {
You can’t perform that action at this time.
0 commit comments