From 903bc9cba5f4128b3005cc1a8152aa7735e33ee7 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 22 Jun 2022 19:05:27 -0700 Subject: [PATCH] [Playlist Info Loader] Do not clear if loading Do not clear the progress indicator if a loading task is already running in the background, but instead return without doing anything. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistLoader.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index 1a05b34da..ea4108518 100644 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -618,9 +618,15 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path); } if(![queueThisJob count]) { - [playlistController performSelectorOnMainThread:@selector(updateTotalTime) withObject:nil waitUntilDone:NO]; - [self completeProgress]; - metadataLoadInProgress = NO; + size_t count; + @synchronized (queuedURLs) { + count = [queuedURLs count]; + } + if(!count) { + [playlistController performSelectorOnMainThread:@selector(updateTotalTime) withObject:nil waitUntilDone:NO]; + [self completeProgress]; + metadataLoadInProgress = NO; + } return; }