From a76abef4291a88aa09779e8fa46dbfc33293f47d Mon Sep 17 00:00:00 2001 From: fiso64 Date: Sat, 28 Oct 2023 19:09:31 +0200 Subject: [PATCH] skip-existing bug --- slsk-batchdl/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slsk-batchdl/Program.cs b/slsk-batchdl/Program.cs index af3529d..24c6bd0 100644 --- a/slsk-batchdl/Program.cs +++ b/slsk-batchdl/Program.cs @@ -780,13 +780,13 @@ static class Program { Console.WriteLine($"Checking if tracks exist in output folder"); var d = RemoveTracksIfExist(tracks, outputFolder, necessaryCond, useTagsCheckExisting, preciseSkip); - d.ToList().ForEach(x => existing.Add(x.Key, x.Value)); + d.ToList().ForEach(x => existing.TryAdd(x.Key, x.Value)); } if (musicDir != "" && System.IO.Directory.Exists(musicDir)) { Console.WriteLine($"Checking if tracks exist in library"); var d = RemoveTracksIfExist(tracks, musicDir, necessaryCond, useTagsCheckExisting, preciseSkip); - d.ToList().ForEach(x => existing.Add(x.Key, x.Value)); + d.ToList().ForEach(x => existing.TryAdd(x.Key, x.Value)); } foreach (var x in existing) @@ -2256,7 +2256,7 @@ static class Program tracks.RemoveAll(x => { bool exists = TrackExistsInCollection(x, necessaryCond, musicFiles, out string? path, precise); - if (exists) existing.Add(x, path); + if (exists) existing.TryAdd(x, path); return exists; }); } @@ -2275,7 +2275,7 @@ static class Program tracks.RemoveAll(x => { bool exists = TrackExistsInCollection(x, necessaryCond, musicIndex, out string? path, precise); - if (exists) existing.Add(x, path); + if (exists) existing.TryAdd(x, path); return exists; }); }