[Playlist Loader] Fix Clear and Play action

Clear and Play was broken by the previous update. This fixes it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
main
Christopher Snowhill 2022-07-06 16:04:03 -07:00
parent 2754a9fca3
commit a03e519c61
1 changed files with 7 additions and 0 deletions

View File

@ -1744,9 +1744,16 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
BOOL sort = [[input objectForKey:@"sort"] boolValue];
URLOrigin origin = (URLOrigin)[[input objectForKey:@"origin"] integerValue];
NSUInteger countNow = [[self content] count];
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
[self willInsertURLs:entries origin:origin];
});
if(countNow && row && ![[self content] count]) {
row = 0;
}
NSArray *urlsAccepted = [playlistLoader insertURLs:entries atIndex:row sort:sort];
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
[self didInsertURLs:urlsAccepted origin:origin];