From 38beb9e9308518876d2ac9cfdb00fb052e993886 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 6 Jul 2022 16:04:03 -0700 Subject: [PATCH] [Playlist Loader] Fix Clear and Play action Clear and Play was broken by the previous update. This fixes it. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index d986eb9ea..e0589225b 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -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];