diff --git a/app/src/main/java/com/malopieds/innertune/db/DatabaseDao.kt b/app/src/main/java/com/malopieds/innertune/db/DatabaseDao.kt index f9731a8fd..975cc5350 100644 --- a/app/src/main/java/com/malopieds/innertune/db/DatabaseDao.kt +++ b/app/src/main/java/com/malopieds/innertune/db/DatabaseDao.kt @@ -966,7 +966,17 @@ interface DatabaseDao { albumPage.songs .map(SongItem::toMediaMetadata) .onEach(::insert) - .mapIndexed { index, song -> + .onEach { + update( + it.toSongEntity().copy( + title = it.title, + duration = it.duration, + thumbnailUrl = it.thumbnailUrl, + albumId = it.album?.id, + albumName = it.album?.title, + ), + ) + }.mapIndexed { index, song -> SongAlbumMap( songId = song.id, albumId = albumPage.album.browseId, @@ -1072,7 +1082,17 @@ interface DatabaseDao { albumPage.songs .map(SongItem::toMediaMetadata) .onEach(::insert) - .mapIndexed { index, song -> + .onEach { + update( + it.toSongEntity().copy( + title = it.title, + duration = it.duration, + thumbnailUrl = it.thumbnailUrl, + albumId = it.album?.id, + albumName = it.album?.title, + ), + ) + }.mapIndexed { index, song -> SongAlbumMap( songId = song.id, albumId = albumPage.album.browseId,