[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>
This commit is contained in:
Christopher Snowhill 2022-06-24 00:34:30 -07:00
parent 80adb85b36
commit cc5de69e9f

View file

@ -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];
}
@ -879,6 +879,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
[playlistController commitPersistentStore];
}
results = [NSArray arrayWithArray:resultsCopy];
{
NSIndexSet *is = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [results count])];