Pass entity bookmarkedAt when updating artists and albums
This commit is contained in:
parent
cbfc41f57e
commit
ccf5a35ff6
4 changed files with 6 additions and 17 deletions
|
@ -40,7 +40,6 @@ import it.vfsfitvnm.vimusic.models.DetailedSong
|
|||
import it.vfsfitvnm.vimusic.models.DetailedSongWithContentLength
|
||||
import it.vfsfitvnm.vimusic.models.Event
|
||||
import it.vfsfitvnm.vimusic.models.Format
|
||||
import it.vfsfitvnm.vimusic.models.PartialArtist
|
||||
import it.vfsfitvnm.vimusic.models.Playlist
|
||||
import it.vfsfitvnm.vimusic.models.PlaylistPreview
|
||||
import it.vfsfitvnm.vimusic.models.PlaylistWithSongs
|
||||
|
@ -427,9 +426,6 @@ interface Database {
|
|||
@Upsert
|
||||
fun upsert(artist: Artist)
|
||||
|
||||
@Upsert(Artist::class)
|
||||
fun upsert(artist: PartialArtist)
|
||||
|
||||
@Delete
|
||||
fun delete(searchQuery: SearchQuery)
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
data class PartialArtist(
|
||||
val id: String,
|
||||
val name: String?,
|
||||
val thumbnailUrl: String?,
|
||||
val info: String?,
|
||||
val timestamp: Long? = null,
|
||||
)
|
|
@ -104,7 +104,8 @@ fun AlbumScreen(browseId: String) {
|
|||
year = albumPage.year,
|
||||
authorsText = albumPage.authors?.joinToString("") { it.name ?: "" },
|
||||
shareUrl = albumPage.url,
|
||||
timestamp = System.currentTimeMillis()
|
||||
timestamp = System.currentTimeMillis(),
|
||||
bookmarkedAt = album?.bookmarkedAt
|
||||
),
|
||||
albumPage
|
||||
.songsPage
|
||||
|
|
|
@ -32,7 +32,7 @@ import it.vfsfitvnm.route.RouteHandler
|
|||
import it.vfsfitvnm.vimusic.Database
|
||||
import it.vfsfitvnm.vimusic.LocalPlayerServiceBinder
|
||||
import it.vfsfitvnm.vimusic.R
|
||||
import it.vfsfitvnm.vimusic.models.PartialArtist
|
||||
import it.vfsfitvnm.vimusic.models.Artist
|
||||
import it.vfsfitvnm.vimusic.query
|
||||
import it.vfsfitvnm.vimusic.savers.ArtistSaver
|
||||
import it.vfsfitvnm.vimusic.savers.InnertubeAlbumsPageSaver
|
||||
|
@ -103,12 +103,13 @@ fun ArtistScreen(browseId: String) {
|
|||
|
||||
query {
|
||||
Database.upsert(
|
||||
PartialArtist(
|
||||
Artist(
|
||||
id = browseId,
|
||||
name = artistPage.name,
|
||||
thumbnailUrl = artistPage.thumbnail?.url,
|
||||
info = artistPage.description,
|
||||
timestamp = System.currentTimeMillis()
|
||||
timestamp = System.currentTimeMillis(),
|
||||
bookmarkedAt = artist?.bookmarkedAt
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue