Redesign AlbumScreen (#172)

This commit is contained in:
vfsfitvnm
2022-09-24 20:18:43 +02:00
parent a54b795666
commit f463f82f72
14 changed files with 1066 additions and 500 deletions

View File

@@ -0,0 +1,22 @@
package it.vfsfitvnm.vimusic.models
import androidx.compose.runtime.Immutable
import androidx.room.Embedded
import androidx.room.Junction
import androidx.room.Relation
@Immutable
data class AlbumWithSongs(
@Embedded val album: Album,
@Relation(
entity = Song::class,
parentColumn = "id",
entityColumn = "id",
associateBy = Junction(
value = SortedSongAlbumMap::class,
parentColumn = "albumId",
entityColumn = "songId"
)
)
val songs: List<DetailedSong>
)

View File

@@ -0,0 +1,13 @@
package it.vfsfitvnm.vimusic.models
import androidx.compose.runtime.Immutable
import androidx.room.ColumnInfo
import androidx.room.DatabaseView
@Immutable
@DatabaseView("SELECT * FROM SongAlbumMap ORDER BY position")
data class SortedSongAlbumMap(
@ColumnInfo(index = true) val songId: String,
@ColumnInfo(index = true) val albumId: String,
val position: Int
)