From 7e06aef932b79900623c7b26d9441deb7a8ffa58 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 24 Jul 2022 23:13:03 -0700 Subject: [PATCH] [Playlist Loader] Deduplicate loaded items Deduplicate loaded tracks, to prevent duplicate items when adding a folder that happens to contain playlists or CUE sheets referencing the very same files. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistLoader.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index 0c7f236ca..52124db65 100644 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -455,6 +455,9 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc [self setProgressStatus:60.0]; } + // Deduplication of contained URLs + [fileURLs removeObjectsInArray:containedURLs]; + DLog(@"File urls: %@", fileURLs); DLog(@"Contained urls: %@", containedURLs);