Skip to content

Commit

Permalink
Create missing queue folder instead of erroring (#1174)
Browse files Browse the repository at this point in the history
* Make missing folder instead of erroring out

* Set queue folder path regardless of existence

* Remove redundant code

* Remove unused translations
  • Loading branch information
ScrubN authored Aug 4, 2024
1 parent d6e0116 commit 2554c75
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 104 deletions.
18 changes: 0 additions & 18 deletions TwitchDownloaderWPF/Translations/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>¿TwitchDownloaderWPF no está disponible en tu idioma? ¡Haz clic para saber cómo ayudar a traducir!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Ruta de carpeta no válida</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>La carpeta no existe</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Cancelado</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF n'est pas disponible dans votre langue maternelle ? Cliquez pour apprendre comment aider à traduire !</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Chemin d'accès au répertoire non valide</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>Le répertoire n'existe pas</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Annulé</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF non è disponibile nella tua lingua? Fai click per sapere come aiutare o tradutte!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Percorso della cartella non valido</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>La cartella non esiste</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Cancellato</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>あなたの母国語でTwitchDownloaderWPFが利用できませんか?クリックで翻訳を手伝う方法を学ぶ!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>不正なフォルダパス</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>フォルダが存在しません</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>キャンセルされた</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.pl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF nie jest dostępny w twoim natywnym języku? Kliknij, aby dowiedzieć się jak nas wspomóc!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Nieprawidłowa Ścieżka Folderu</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>Folder nie istnieje</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Anulowano</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.pt-br.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>O TwitchDownloaderWPF não está disponível em sua languagem nativa? Clique para aprender como ajudar a traduzir!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Diretório da Pasta Inválido</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>A pasta não existe</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Cancelado</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>Is TwitchDownloaderWPF not available in your native language? Click to learn how to help translate!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Invalid Folder Path</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>The folder does not exist</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Canceled</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF не доступен на твоем языке? Нажми здесь чтобы узнать как помочь с переводом!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Неправильный путь к папке</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>Папка не существует</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Отменено</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.tr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF ana dilinizde mevcut değil mi? Çeviriye nasıl yardım edeceğinizi öğrenmek için tıklayın!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Geçersiz Klasör Yolu</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>Klasör mevcut değil</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>İptal edildi</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.uk.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF недоступно на вашій мові? Натисніть тут, щоб дізнатися, як допомогти з перекладом!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>Неправильний шлях до папки</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>Папка не існує</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>Скасовано</value>
</data>
Expand Down
6 changes: 0 additions & 6 deletions TwitchDownloaderWPF/Translations/Strings.zh-cn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,6 @@
<data name="ApplicationLanguageTooltip" xml:space="preserve">
<value>TwitchDownloaderWPF 没有你的母语版本?点击了解如何帮助翻译!</value>
</data>
<data name="InvalidFolderPath" xml:space="preserve">
<value>文件夹路径无效</value>
</data>
<data name="InvaliFolderPathMessage" xml:space="preserve">
<value>文件夹不存在</value>
</data>
<data name="StatusCanceled" xml:space="preserve">
<value>已取消</value>
</data>
Expand Down
29 changes: 9 additions & 20 deletions TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using TwitchDownloaderCore;
using TwitchDownloaderCore.Options;
using TwitchDownloaderCore.Tools;
using TwitchDownloaderWPF.Properties;
Expand All @@ -28,9 +29,7 @@ public WindowQueueOptions(Page page)
_parentPage = page;
InitializeComponent();

string queueFolder = Settings.Default.QueueFolder;
if (Directory.Exists(queueFolder))
textFolder.Text = queueFolder;
textFolder.Text = Settings.Default.QueueFolder;

TextPreferredQuality.Visibility = Visibility.Collapsed;
ComboPreferredQuality.Visibility = Visibility.Collapsed;
Expand Down Expand Up @@ -95,9 +94,7 @@ public WindowQueueOptions(List<TaskData> dataList)
_dataList = dataList;
InitializeComponent();

string queueFolder = Settings.Default.QueueFolder;
if (Directory.Exists(queueFolder))
textFolder.Text = queueFolder;
textFolder.Text = Settings.Default.QueueFolder;

if (_dataList.Any(x => x.Id.All(char.IsDigit)))
{
Expand Down Expand Up @@ -129,8 +126,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
string folderPath = textFolder.Text;
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

VideoDownloadOptions downloadOptions = vodDownloadPage.GetOptions(null, textFolder.Text);
Expand Down Expand Up @@ -230,8 +226,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
string folderPath = textFolder.Text;
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

ClipDownloadOptions downloadOptions = new ClipDownloadOptions
Expand Down Expand Up @@ -335,8 +330,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
string folderPath = textFolder.Text;
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

ChatDownloadOptions chatOptions = MainWindow.pageChatDownload.GetOptions(null);
Expand Down Expand Up @@ -393,8 +387,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
string folderPath = textFolder.Text;
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

ChatUpdateOptions chatOptions = MainWindow.pageChatUpdate.GetOptions(null);
Expand Down Expand Up @@ -430,8 +423,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
{
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

string fileFormat = chatRenderPage.comboFormat.SelectedItem.ToString()!;
Expand Down Expand Up @@ -474,8 +466,7 @@ private void EnqueueDataList()
string folderPath = textFolder.Text;
if (!Directory.Exists(folderPath))
{
MessageBox.Show(this, Translations.Strings.InvaliFolderPathMessage, Translations.Strings.InvalidFolderPath, MessageBoxButton.OK, MessageBoxImage.Error);
return;
TwitchHelper.CreateDirectory(folderPath);
}

foreach (var taskData in _dataList)
Expand Down Expand Up @@ -630,8 +621,6 @@ private void EnqueueDataList()
private void btnFolder_Click(object sender, RoutedEventArgs e)
{
var dialog = new Ookii.Dialogs.Wpf.VistaFolderBrowserDialog();
if (Directory.Exists(textFolder.Text))
dialog.RootFolder = dialog.RootFolder;
if (dialog.ShowDialog(this).GetValueOrDefault())
{
textFolder.Text = dialog.SelectedPath;
Expand Down

0 comments on commit 2554c75

Please sign in to comment.