[Core Data Store] Fix startup playlist pruning
The playlist was being pruned of entries marked for deletion, but they were not being pruned from the set that was then added to the player. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
ba33218ddf
commit
6d772562ca
|
@ -868,7 +868,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
|
|||
NSMutableIndexSet *pruneSet = [[NSMutableIndexSet alloc] init];
|
||||
NSUInteger index = 0;
|
||||
for(PlaylistEntry *pe in resultsCopy) {
|
||||
if(pe.deLeted || !pe.url) {
|
||||
if(pe.deLeted || !pe.urlString || [pe.urlString length] < 1) {
|
||||
[pruneSet addIndex:index];
|
||||
[moc deleteObject:pe];
|
||||
}
|
||||
|
@ -878,6 +878,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
|
|||
if([pruneSet count]) {
|
||||
[playlistController commitPersistentStore];
|
||||
}
|
||||
|
||||
results = [NSArray arrayWithArray:resultsCopy];
|
||||
|
||||
{
|
||||
NSIndexSet *is = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [results count])];
|
||||
|
|
Loading…
Reference in New Issue