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,
|
||||
playlistId: String,
|
||||
position: Long,
|
||||
)
|
||||
): Int
|
||||
|
||||
@Query(
|
||||
"DELETE FROM playlist_songs WHERE sourceId = :sourceId " +
|
||||
|
||||
@@ -511,9 +511,7 @@ class SyncService(
|
||||
commitOrigins {
|
||||
db.useWriterConnection { connection ->
|
||||
connection.immediateTransaction {
|
||||
val before = connection.totalChanges()
|
||||
db.libraryDao().deletePlaylistSongsFrom(source.id, playlistId, position)
|
||||
val changed = connection.totalChanges() != before
|
||||
val changed = db.libraryDao().deletePlaylistSongsFrom(source.id, playlistId, position) > 0
|
||||
if (changed) {
|
||||
changedOrigins += origin(QueueKind.Playlist, playlistId)
|
||||
connection.persistPendingOrigins()
|
||||
|
||||
Reference in New Issue
Block a user