Skip to content

Commit 603bae0

Browse files
committed
Apply f6a7b97 once again
1 parent f28a4d5 commit 603bae0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/main/java/io/github/muntashirakon/music/activities/albums/AlbumDetailsViewModel.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import kotlinx.coroutines.Deferred
1313
import kotlinx.coroutines.Dispatchers
1414
import kotlinx.coroutines.async
1515
import kotlinx.coroutines.launch
16+
import java.lang.Exception
1617

1718
class 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) {

0 commit comments

Comments
 (0)