From 92b3cc2b3371a936e083883bf32935f053288991 Mon Sep 17 00:00:00 2001 From: vfsfitvnm Date: Sat, 3 Sep 2022 19:38:48 +0200 Subject: [PATCH] Do not return unused artist info in DetailedSong --- .../main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSong.kt | 5 +++-- .../vimusic/models/DetailedSongWithContentLength.kt | 2 +- app/src/main/kotlin/it/vfsfitvnm/vimusic/models/Info.kt | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 app/src/main/kotlin/it/vfsfitvnm/vimusic/models/Info.kt diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSong.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSong.kt index e3acf72..4881e00 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSong.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSong.kt @@ -27,9 +27,10 @@ open class DetailedSong( value = SongArtistMap::class, parentColumn = "songId", entityColumn = "artistId" - ) + ), + projection = ["id", "name"] ) - val artists: List? + val artists: List? ) { val formattedTotalPlayTime: String get() { diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSongWithContentLength.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSongWithContentLength.kt index 47ccbae..c2ee106 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSongWithContentLength.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/DetailedSongWithContentLength.kt @@ -12,7 +12,7 @@ class DetailedSongWithContentLength( thumbnailUrl: String?, totalPlayTimeMs: Long = 0, albumId: String?, - artists: List?, + artists: List?, @Relation( entity = Format::class, entityColumn = "songId", diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/Info.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/Info.kt new file mode 100644 index 0000000..52ae2a6 --- /dev/null +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/models/Info.kt @@ -0,0 +1,6 @@ +package it.vfsfitvnm.vimusic.models + +data class Info( + val id: String, + val name: String +)