From cbaa6c2fa6496b941298fd5f3dabd9dc43a71a32 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:37:07 -0400 Subject: [PATCH 1/5] Revert removing unused translations (from #1174) --- .../Translations/Strings.Designer.cs | 18 ++++++++++++++++++ .../Translations/Strings.es.resx | 6 ++++++ .../Translations/Strings.fr.resx | 6 ++++++ .../Translations/Strings.it.resx | 6 ++++++ .../Translations/Strings.ja.resx | 6 ++++++ .../Translations/Strings.pl.resx | 6 ++++++ .../Translations/Strings.pt-br.resx | 6 ++++++ TwitchDownloaderWPF/Translations/Strings.resx | 6 ++++++ .../Translations/Strings.ru.resx | 6 ++++++ .../Translations/Strings.tr.resx | 6 ++++++ .../Translations/Strings.uk.resx | 6 ++++++ .../Translations/Strings.zh-cn.resx | 6 ++++++ 12 files changed, 84 insertions(+) diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 33119a62..c3138f44 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -1283,6 +1283,24 @@ public static string InvalidClipLinkIdMessage { } } + /// + /// Looks up a localized string similar to Invalid Folder Path. + /// + public static string InvalidFolderPath { + get { + return ResourceManager.GetString("InvalidFolderPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The folder does not exist. + /// + public static string InvalidFolderPathMessage { + get { + return ResourceManager.GetString("InvalidFolderPathMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid start or end time. /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index fbc7add9..eb354af6 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -672,6 +672,12 @@ ¿TwitchDownloaderWPF no está disponible en tu idioma? ¡Haz clic para saber cómo ayudar a traducir! + + Ruta de carpeta no válida + + + La carpeta no existe + Cancelado diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index 4d3e41a1..2861a1c1 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF n'est pas disponible dans votre langue maternelle ? Cliquez pour apprendre comment aider à traduire ! + + Chemin d'accès au répertoire non valide + + + Le répertoire n'existe pas + Annulé diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index ebd21332..df1ffa21 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF non è disponibile nella tua lingua? Fai click per sapere come aiutare o tradutte! + + Percorso della cartella non valido + + + La cartella non esiste + Cancellato diff --git a/TwitchDownloaderWPF/Translations/Strings.ja.resx b/TwitchDownloaderWPF/Translations/Strings.ja.resx index 986da9b5..1ad82b49 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ja.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ja.resx @@ -672,6 +672,12 @@ あなたの母国語でTwitchDownloaderWPFが利用できませんか?クリックで翻訳を手伝う方法を学ぶ! + + 不正なフォルダパス + + + フォルダが存在しません + キャンセルされた diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index ff2d6bb1..e3b04be3 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF nie jest dostępny w twoim natywnym języku? Kliknij, aby dowiedzieć się jak nas wspomóc! + + Nieprawidłowa Ścieżka Folderu + + + Folder nie istnieje + Anulowano diff --git a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx index 761004d4..595285be 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx @@ -676,6 +676,12 @@ O TwitchDownloaderWPF não está disponível em sua languagem nativa? Clique para aprender como ajudar a traduzir! + + Diretório da Pasta Inválido + + + A pasta não existe + Cancelado diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index 20a48f4b..f92974c8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -672,6 +672,12 @@ Is TwitchDownloaderWPF not available in your native language? Click to learn how to help translate! + + Invalid Folder Path + + + The folder does not exist + Canceled diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index c4b6ae16..07ae0e50 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF не доступен на твоем языке? Нажми здесь чтобы узнать как помочь с переводом! + + Неправильный путь к папке + + + Папка не существует + Отменено diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index d54f7a12..b4a31ed0 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -673,6 +673,12 @@ TwitchDownloaderWPF ana dilinizde mevcut değil mi? Çeviriye nasıl yardım edeceğinizi öğrenmek için tıklayın! + + Geçersiz Klasör Yolu + + + Klasör mevcut değil + İptal edildi diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 68f46d76..74ef98e8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF недоступно на вашій мові? Натисніть тут, щоб дізнатися, як допомогти з перекладом! + + Неправильний шлях до папки + + + Папка не існує + Скасовано diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index 3fd7adff..5e9a0afb 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -672,6 +672,12 @@ TwitchDownloaderWPF 没有你的母语版本?点击了解如何帮助翻译! + + 文件夹路径无效 + + + 文件夹不存在 + 已取消 From d9306e87d1f85d80009c796af7faa40e542b0de8 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:43:37 -0400 Subject: [PATCH 2/5] Fix application crash when enqueuing to an invalid destination folder --- .../WindowQueueOptions.xaml.cs | 96 +++++++++++++++++-- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs b/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs index 33f3e0c2..a9110f82 100644 --- a/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs +++ b/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs @@ -126,7 +126,21 @@ private void btnQueue_Click(object sender, RoutedEventArgs e) string folderPath = textFolder.Text; if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } VideoDownloadOptions downloadOptions = vodDownloadPage.GetOptions(null, textFolder.Text); @@ -226,7 +240,21 @@ private void btnQueue_Click(object sender, RoutedEventArgs e) string folderPath = textFolder.Text; if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } ClipDownloadOptions downloadOptions = new ClipDownloadOptions @@ -330,7 +358,21 @@ private void btnQueue_Click(object sender, RoutedEventArgs e) string folderPath = textFolder.Text; if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } ChatDownloadOptions chatOptions = MainWindow.pageChatDownload.GetOptions(null); @@ -387,7 +429,21 @@ private void btnQueue_Click(object sender, RoutedEventArgs e) string folderPath = textFolder.Text; if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } ChatUpdateOptions chatOptions = MainWindow.pageChatUpdate.GetOptions(null); @@ -423,7 +479,21 @@ private void btnQueue_Click(object sender, RoutedEventArgs e) { if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } string fileFormat = chatRenderPage.comboFormat.SelectedItem.ToString()!; @@ -466,7 +536,21 @@ private void EnqueueDataList() string folderPath = textFolder.Text; if (!Directory.Exists(folderPath)) { - TwitchHelper.CreateDirectory(folderPath); + try + { + TwitchHelper.CreateDirectory(folderPath); + } + catch (Exception ex) + { + MessageBox.Show(this, Translations.Strings.InvalidFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error); + + if (Settings.Default.VerboseErrors) + { + MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error); + } + + return; + } } foreach (var taskData in _dataList) From b2422de932e402c4b3d533b8aaa1ba6598159d2c Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:44:12 -0400 Subject: [PATCH 3/5] Fix default enqueue folder only saving when the browser button was used --- TwitchDownloaderWPF/WindowQueueOptions.xaml | 2 +- TwitchDownloaderWPF/WindowQueueOptions.xaml.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/TwitchDownloaderWPF/WindowQueueOptions.xaml b/TwitchDownloaderWPF/WindowQueueOptions.xaml index 154a73eb..2adfd47b 100644 --- a/TwitchDownloaderWPF/WindowQueueOptions.xaml +++ b/TwitchDownloaderWPF/WindowQueueOptions.xaml @@ -30,7 +30,7 @@ - +