Reflect database migration

This commit is contained in:
vfsfitvnm 2022-06-29 15:24:00 +02:00
parent 6f5bc02216
commit 95879e7a6e
3 changed files with 7 additions and 9 deletions

View file

@ -121,10 +121,10 @@ interface Database {
@Query("SELECT thumbnailUrl FROM Song JOIN SongInPlaylist ON id = songId WHERE playlistId = :id ORDER BY position LIMIT 4")
fun playlistThumbnailUrls(id: Long): Flow<List<String?>>
// @Transaction
// @RewriteQueriesToDropUnusedColumns
// @Query("SELECT * FROM Info JOIN SongWithAuthors ON Info.id = SongWithAuthors.authorInfoId JOIN Song ON SongWithAuthors.songId = Song.id WHERE browseId = :artistId ORDER BY Song.ROWID DESC")
// fun artistSongs(artistId: String): Flow<List<DetailedSong>>
@Transaction
@Query("SELECT * FROM Song JOIN SongArtistMap ON Song.id = SongArtistMap.songId WHERE SongArtistMap.artistId = :artistId ORDER BY Song.ROWID DESC")
@RewriteQueriesToDropUnusedColumns
fun artistSongs(artistId: String): Flow<List<DetailedSong>>
@Insert(onConflict = OnConflictStrategy.ABORT)
fun insertQueue(queuedMediaItems: List<QueuedMediaItem>)

View file

@ -97,9 +97,8 @@ fun ArtistScreen(
}
val songs by remember(browseId) {
flowOf(emptyList<DetailedSong>())
// Database.artistSongs(browseId)
}.collectAsState(initial = emptyList<DetailedSong>(), context = Dispatchers.IO)
Database.artistSongs(browseId)
}.collectAsState(initial = emptyList(), context = Dispatchers.IO)
LazyColumn(
state = lazyListState,

View file

@ -458,8 +458,7 @@ fun PlayerView(
)
BasicText(
text = playerState.mediaMetadata.extras?.getStringArrayList("artistNames")
?.joinToString("") ?: "",
text = playerState.mediaMetadata.artist?.toString() ?: "",
style = typography.s.semiBold.secondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,