mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-15 00:42:54 +01:00
sync: use playlist deletion count
This commit is contained in:
@@ -629,7 +629,7 @@ interface LibraryDao {
|
|||||||
sourceId: Long,
|
sourceId: Long,
|
||||||
playlistId: String,
|
playlistId: String,
|
||||||
position: Long,
|
position: Long,
|
||||||
)
|
): Int
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
"DELETE FROM playlist_songs WHERE sourceId = :sourceId " +
|
"DELETE FROM playlist_songs WHERE sourceId = :sourceId " +
|
||||||
|
|||||||
@@ -511,9 +511,7 @@ class SyncService(
|
|||||||
commitOrigins {
|
commitOrigins {
|
||||||
db.useWriterConnection { connection ->
|
db.useWriterConnection { connection ->
|
||||||
connection.immediateTransaction {
|
connection.immediateTransaction {
|
||||||
val before = connection.totalChanges()
|
val changed = db.libraryDao().deletePlaylistSongsFrom(source.id, playlistId, position) > 0
|
||||||
db.libraryDao().deletePlaylistSongsFrom(source.id, playlistId, position)
|
|
||||||
val changed = connection.totalChanges() != before
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
changedOrigins += origin(QueueKind.Playlist, playlistId)
|
changedOrigins += origin(QueueKind.Playlist, playlistId)
|
||||||
connection.persistPendingOrigins()
|
connection.persistPendingOrigins()
|
||||||
|
|||||||
Reference in New Issue
Block a user