Add shuffle/radio data to Artist

This commit is contained in:
vfsfitvnm
2022-06-29 20:14:44 +02:00
parent 9103c30044
commit 309a1a4237
3 changed files with 468 additions and 2 deletions

View File

@@ -52,6 +52,9 @@ interface Database {
@Query("SELECT * FROM Song")
fun songs(): Flow<List<Song>>
@Query("SELECT * FROM Artist WHERE id = :id")
fun artist(id: String): Flow<Artist?>
@Transaction
@Query("SELECT * FROM Song WHERE id = :id")
fun songWithInfo(id: String): DetailedSong?
@@ -96,6 +99,9 @@ interface Database {
@Update
fun update(song: Song)
@Update
fun update(artist: Artist)
@Update
fun update(songInPlaylist: SongInPlaylist)
@@ -150,7 +156,7 @@ interface Database {
views = [
SortedSongInPlaylist::class
],
version = 10,
version = 11,
exportSchema = true,
autoMigrations = [
AutoMigration(from = 1, to = 2),
@@ -161,6 +167,7 @@ interface Database {
AutoMigration(from = 6, to = 7),
AutoMigration(from = 7, to = 8, spec = DatabaseInitializer.From7To8Migration::class),
AutoMigration(from = 9, to = 10),
AutoMigration(from = 10, to = 11),
],
)
@TypeConverters(Converters::class)

View File

@@ -8,5 +8,9 @@ data class Artist(
@PrimaryKey val id: String,
val name: String,
val thumbnailUrl: String?,
val info: String?
val info: String?,
val shuffleVideoId: String? = null,
val shufflePlaylistId: String? = null,
val radioVideoId: String? = null,
val radioPlaylistId: String? = null,
)