Clear SongAlbumMaps before upserting new album data
This commit is contained in:
@@ -305,6 +305,9 @@ interface Database {
|
|||||||
@Query("DELETE FROM SongPlaylistMap WHERE playlistId = :id")
|
@Query("DELETE FROM SongPlaylistMap WHERE playlistId = :id")
|
||||||
fun clearPlaylist(id: Long)
|
fun clearPlaylist(id: Long)
|
||||||
|
|
||||||
|
@Query("DELETE FROM SongAlbumMap WHERE albumId = :id")
|
||||||
|
fun clearAlbum(id: String)
|
||||||
|
|
||||||
@Query("SELECT loudnessDb FROM Format WHERE songId = :songId")
|
@Query("SELECT loudnessDb FROM Format WHERE songId = :songId")
|
||||||
fun loudnessDb(songId: String): Flow<Float?>
|
fun loudnessDb(songId: String): Flow<Float?>
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ fun AlbumScreen(browseId: String) {
|
|||||||
?.onSuccess { currentAlbumPage ->
|
?.onSuccess { currentAlbumPage ->
|
||||||
albumPage = currentAlbumPage
|
albumPage = currentAlbumPage
|
||||||
|
|
||||||
|
Database.clearAlbum(browseId)
|
||||||
|
|
||||||
Database.upsert(
|
Database.upsert(
|
||||||
Album(
|
Album(
|
||||||
id = browseId,
|
id = browseId,
|
||||||
|
|||||||
Reference in New Issue
Block a user