Do not return unused fields in DetailedSong

This commit is contained in:
vfsfitvnm
2022-08-03 21:09:08 +02:00
parent 194864bcb4
commit 61c8552ad0
12 changed files with 68 additions and 58 deletions

View File

@@ -251,7 +251,7 @@ fun AlbumScreen(browseId: String) {
songs.forEachIndexed { index, song ->
Database.insert(
SongPlaylistMap(
songId = song.song.id,
songId = song.id,
playlistId = playlistId,
position = index
)
@@ -320,13 +320,13 @@ fun AlbumScreen(browseId: String) {
itemsIndexed(
items = songs,
key = { _, song -> song.song.id },
key = { _, song -> song.id },
contentType = { _, song -> song }
) { index, song ->
SongItem(
title = song.song.title,
authors = song.song.artistsText ?: albumResult?.getOrNull()?.authorsText,
durationText = song.song.durationText,
title = song.title,
authors = song.artistsText ?: albumResult?.getOrNull()?.authorsText,
durationText = song.durationText,
onClick = {
binder?.stopRadio()
binder?.player?.forcePlayAtIndex(

View File

@@ -247,7 +247,7 @@ fun ArtistScreen(browseId: String) {
itemsIndexed(
items = songs,
key = { _, song -> song.song.id },
key = { _, song -> song.id },
contentType = { _, song -> song },
) { index, song ->
SongItem(

View File

@@ -74,7 +74,7 @@ fun BuiltInPlaylistScreen(builtInPlaylist: BuiltInPlaylist) {
BuiltInPlaylist.Offline -> Database.songsWithContentLength().map { songs ->
songs.filter { song ->
song.contentLength?.let {
binder?.cache?.isCached(song.song.id, 0, song.contentLength)
binder?.cache?.isCached(song.id, 0, song.contentLength)
} ?: false
}
}
@@ -180,7 +180,7 @@ fun BuiltInPlaylistScreen(builtInPlaylist: BuiltInPlaylist) {
itemsIndexed(
items = songs,
key = { _, song -> song.song.id },
key = { _, song -> song.id },
contentType = { _, song -> song },
) { index, song ->
SongItem(

View File

@@ -625,9 +625,7 @@ fun HomeScreen() {
itemsIndexed(
items = songCollection,
key = { _, song ->
song.song.id
},
key = { _, song -> song.id },
contentType = { _, song -> song }
) { index, song ->
SongItem(
@@ -652,7 +650,7 @@ fun HomeScreen() {
.align(Alignment.BottomCenter)
) {
BasicText(
text = song.song.formattedTotalPlayTime,
text = song.formattedTotalPlayTime,
style = typography.xxs.semiBold.center.color(Color.White),
maxLines = 2,
overflow = TextOverflow.Ellipsis,

View File

@@ -242,7 +242,7 @@ fun LocalPlaylistScreen(playlistId: Long) {
itemsIndexed(
items = playlistWithSongs.songs,
key = { _, song -> song.song.id },
key = { _, song -> song.id },
contentType = { _, song -> song },
) { index, song ->
SongItem(
@@ -301,7 +301,7 @@ fun LocalPlaylistScreen(playlistId: Long) {
Database.update(
SongPlaylistMap(
songId = playlistWithSongs.songs[index].song.id,
songId = playlistWithSongs.songs[index].id,
playlistId = playlistWithSongs.playlist.id,
position = reachedIndex
)