diff --git a/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt b/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt index 2dec0bb94..71b5bd610 100644 --- a/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt +++ b/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt @@ -184,7 +184,17 @@ interface DatabaseDao : SongsDao, AlbumsDao, ArtistsDao, PlaylistsDao, QueueDao ) return 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, @@ -225,7 +235,17 @@ interface DatabaseDao : SongsDao, AlbumsDao, ArtistsDao, PlaylistsDao, QueueDao ) 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,