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 committed Nov 2, 2024
1 parent 1e451af commit 386deb4
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions app/src/main/java/com/malopieds/innertune/db/DatabaseDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 386deb4

Please sign in to comment.