diff --git a/TwitchDownloaderCore/TwitchHelper.cs b/TwitchDownloaderCore/TwitchHelper.cs
index a5943c3b..71f9be56 100644
--- a/TwitchDownloaderCore/TwitchHelper.cs
+++ b/TwitchDownloaderCore/TwitchHelper.cs
@@ -927,6 +927,7 @@ public static void CleanUpClaimedFile([AllowNull] FileInfo fileInfo, [AllowNull]
}
}
+ ///
public static DirectoryInfo CreateDirectory(string path)
{
DirectoryInfo directoryInfo = Directory.CreateDirectory(path);
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 没有你的母语版本?点击了解如何帮助翻译!
+
+ 文件夹路径无效
+
+
+ 文件夹不存在
+
已取消
diff --git a/TwitchDownloaderWPF/WindowQueueOptions.xaml b/TwitchDownloaderWPF/WindowQueueOptions.xaml
index 154a73eb..5d32d3bd 100644
--- a/TwitchDownloaderWPF/WindowQueueOptions.xaml
+++ b/TwitchDownloaderWPF/WindowQueueOptions.xaml
@@ -30,7 +30,7 @@
-
+
diff --git a/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs b/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
index 33f3e0c2..54a80b08 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)
@@ -624,11 +708,18 @@ private void btnFolder_Click(object sender, RoutedEventArgs e)
if (dialog.ShowDialog(this).GetValueOrDefault())
{
textFolder.Text = dialog.SelectedPath;
- Settings.Default.QueueFolder = textFolder.Text;
- Settings.Default.Save();
}
}
+ private void TextFolder_OnTextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!IsInitialized)
+ return;
+
+ Settings.Default.QueueFolder = textFolder.Text;
+ Settings.Default.Save();
+ }
+
private void checkChat_Checked(object sender, RoutedEventArgs e)
{
checkRender.IsEnabled = true;