[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
Christopher Snowhill 2022-06-24 00:34:30 -07:00
parent ba33218ddf
commit 6d772562ca
1 changed files with 3 additions and 1 deletions

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])];