fiso64 / slsk-batchdl

A batch downloader for Soulseek
GNU General Public License v3.0
216 stars 16 forks source link

Unhandled exception. System.ArgumentException: An item with the same key has already been added. #8

Closed oozone closed 11 months ago

oozone commented 11 months ago

Thanks for the great script! Got this error when executing again. The first time works perfectly, then it crashes it with this error. It's on macOS Arm chip if that matters.

slsk-batchdl -i spotify-likes --m3u --skip-existing --skip-mode name  --music-dir <path>/Music/Spotify\ Likes -p <path>/Music/Spotify\ Likes
objc[40659]: Class PlaceholderObject is implemented in both /Users/<me>slsk-batchdl/slsk-batchdl/bin/Release/net6.0/osx-arm64/slsk-batchdl (0x1048453f0) and /Users/<me>/slsk-batchdl/slsk-batchdl/bin/Release/net6.0/osx-arm64/libSystem.Native.dylib (0x104c14600). One of the two will be used. Which one is undefined.
Loading Spotify likes
Checking if tracks exist in library
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: Vintage Culture - Free (237s)
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at Program.<>c__DisplayClass106_0.<RemoveTracksIfExist>b__1(Track x) in /Users/<me>/slsk-batchdl/slsk-batchdl/Program.cs:line 2258
   at System.Collections.Generic.List`1.RemoveAll(Predicate`1 match)
   at Program.RemoveTracksIfExist(List`1 tracks, String dir, FileConditions necessaryCond, Boolean useTags, Boolean precise) in /Users/<me>/slsk-batchdl/slsk-batchdl/Program.cs:line 2256
   at Program.Main(String[] args) in /Users/<me>/slsk-batchdl/slsk-batchdl/Program.cs:line 787
   at Program.<Main>(String[] args)
[1]    40659 abort      slsk-batchdl -i spotify-likes --m3u --skip-existing --skip-mode name   -p
fiso64 commented 11 months ago

Should be fixed now

By the way, there's no need to specify --music-dir if it's the same as the output folder since --skip-existing will always make it check the output folder anyways.

oozone commented 11 months ago

Yeah, it's fixed thanks! Made a PR for mac publishing.

Yelbow commented 11 months ago

I have this issue still

Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: xxx - xxx (235s)
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Program.<>c__DisplayClass98_0.<RemoveTracksIfExist>b__1(Track x) in /Users/JellePieterse/slsk-batchdl/slsk-batchdl/Program.cs:line 1951
   at System.Collections.Generic.List`1.RemoveAll(Predicate`1 match)
   at Program.RemoveTracksIfExist(List`1 tracks, String dir, FileConditions necessaryCond, Boolean useTags, Boolean precise) in /Users/JellePieterse/slsk-batchdl/slsk-batchdl/Program.cs:line 1948
fiso64 commented 11 months ago

@Yelbow I haven't uploaded the fixed binaries yet. You can build them yourself now though