From 088350814fdefedfb770c443de58bd3cfa2b819d Mon Sep 17 00:00:00 2001 From: fiso64 Date: Thu, 7 Mar 2024 18:49:05 +0100 Subject: [PATCH] fix special characters at the end of folder name --- slsk-batchdl/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slsk-batchdl/Program.cs b/slsk-batchdl/Program.cs index 8d7a92c..c119414 100644 --- a/slsk-batchdl/Program.cs +++ b/slsk-batchdl/Program.cs @@ -803,7 +803,7 @@ static class Program } } - folderName = ReplaceInvalidChars(folderName, " "); + folderName = ReplaceInvalidChars(folderName, " ").Trim(); outputFolder = Path.Combine(parentFolder, folderName); @@ -1170,7 +1170,7 @@ static class Program await DownloadFile(x.response, x.file, saveFilePath, track, progress); break; } - catch + catch (Exception e) { downloading = false; if (!client.State.HasFlag(SoulseekClientStates.LoggedIn)) @@ -1179,6 +1179,7 @@ static class Program if (--maxRetriesPerTrack <= 0) { RefreshOrPrint(progress, 0, $"Out of download retries: {track}, skipping", true); + WriteLine("Last error was: " + e.Message, ConsoleColor.DarkYellow, true); throw new SearchAndDownloadException("Out of download retries"); } }