Skip to content

Commit

Permalink
fix: assure time is showed for albums, #67
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds authored and reocat committed Nov 12, 2024
1 parent f4ef164 commit 521c960
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 521c960

Please sign in to comment.