From d972a6eaf5e467baa73b75b918d842d9ffbc16b8 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 17 Jun 2022 04:34:17 -0700 Subject: [PATCH] [Playlist] Correctly handle deleted items The member that I set myself to indicate deletion has one capital letter to differentiate it from the built-in "delete" property of managed objects, which doesn't do what I want, so I had to dodge it with that capitalization thing. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 4 ++-- Playlist/PlaylistLoader.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index f75bd3d7a..1dad1d8e7 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -1079,7 +1079,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc } else { NSInteger i; - if(pe.deleted) // Was a current entry, now removed. + if(pe.deLeted) // Was a current entry, now removed. { if(nextEntryAfterDeleted) i = nextEntryAfterDeleted.index; @@ -1295,7 +1295,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc NSMutableIndexSet *refreshSet = [[NSMutableIndexSet alloc] init]; - if(currentEntry != nil && !currentEntry.deleted) [refreshSet addIndex:currentEntry.index]; + if(currentEntry != nil && !currentEntry.deLeted) [refreshSet addIndex:currentEntry.index]; if(pe != nil) [refreshSet addIndex:pe.index]; // Refresh entire row to refresh tooltips diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index dbf6f50ee..9c16908f5 100644 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -640,7 +640,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc NSBlockOperation *op = [[NSBlockOperation alloc] init]; [op addExecutionBlock:^{ - if(weakPe.deleted) { + if(weakPe.deLeted) { [weakLock lock]; progress += progressstep; [self setProgressJobStatus:progress]; @@ -684,7 +684,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc __block PlaylistEntry *weakPe = [outArray objectAtIndex:i]; __block NSDictionary *entryInfo = [outArray objectAtIndex:i + 1]; dispatch_sync_reentrant(dispatch_get_main_queue(), ^{ - if(!weakPe.deleted) { + if(!weakPe.deLeted) { [weakPe setMetadata:entryInfo]; } progress += progressstep;