From e36c1404ee30b35986734762384127b32912a2c9 Mon Sep 17 00:00:00 2001 From: Mateusz Skoczek Date: Sun, 15 May 2022 22:13:47 +0200 Subject: [PATCH] 1.0-dev18 (prerelease 1 completed) --- .../DownloadTaskEndedSuccessfullyEventArgs.cs | 24 -- ...ownloadTaskEndedUnsuccessfullyEventArgs.cs | 24 -- .../DownloadTaskScheduledEventArgs.cs | 24 -- .../DownloadTaskStatusChangedEventArgs.cs | 61 ++++ VDownload.Core/Services/Config.cs | 1 - VDownload.Core/Services/DownloadTask.cs | 54 ++-- VDownload.Core/VDownload.Core.csproj | 6 +- VDownload/App.xaml.cs | 5 +- .../Assets/Icons/ActiveTasksNumberDark.svg | 12 + .../Assets/Icons/ActiveTasksNumberLight.svg | 12 + .../Assets/Icons/CustomMediaLocationDark.svg | 3 + .../Assets/Icons/CustomMediaLocationLight.svg | 3 + .../Icons/DefaultAudioExtensionDark.svg | 3 + .../Icons/DefaultAudioExtensionLight.svg | 3 + .../Assets/Icons/DefaultMediaTypeDark.svg | 3 + .../Assets/Icons/DefaultMediaTypeLight.svg | 3 + .../Icons/DefaultVideoExtensionDark.svg | 3 + .../Icons/DefaultVideoExtensionLight.svg | 3 + ...asksTemporaryFilesIfEndedWithErrorDark.svg | 3 + ...sksTemporaryFilesIfEndedWithErrorLight.svg | 3 + .../Icons/DeleteTemporaryFilesOnStartDark.svg | 3 + .../DeleteTemporaryFilesOnStartLight.svg | 3 + .../Assets/Icons/EditingAlgorithmDark.svg | 3 + .../Assets/Icons/EditingAlgorithmLight.svg | 3 + .../Assets/Icons/FilenameTemplateDark.svg | 3 + .../Assets/Icons/FilenameTemplateLight.svg | 3 + .../Assets/Icons/LastMediaLocationDark.svg | 3 + .../Assets/Icons/LastMediaLocationLight.svg | 3 + .../Icons/MeteredConnectionDelayDark.svg | 3 + .../Icons/MeteredConnectionDelayLight.svg | 3 + .../Icons/MeteredConnectionWarningDark.svg | 9 + .../Icons/MeteredConnectionWarningLight.svg | 9 + .../Icons/RemoveSuccessfullyEndedTaskDark.svg | 3 + .../RemoveSuccessfullyEndedTaskLight.svg | 3 + VDownload/Assets/Icons/ReplaceFileDark.svg | 3 + VDownload/Assets/Icons/ReplaceFileLight.svg | 3 + .../ShowNotifcationWhenSuccessfulDark.svg | 6 + .../ShowNotifcationWhenSuccessfulLight.svg | 6 + .../ShowNotifcationWhenUnsuccessfulDark.svg | 6 + .../ShowNotifcationWhenUnsuccessfulLight.svg | 6 + .../Icons/TemporaryFilesLocationDark.svg | 3 + .../Icons/TemporaryFilesLocationLight.svg | 3 + .../Assets/Icons/TranscodingAlgorithmDark.svg | 3 + .../Icons/TranscodingAlgorithmLight.svg | 3 + .../Icons/UseHardwareAccelerationDark.svg | 3 + .../Icons/UseHardwareAccelerationLight.svg | 3 + VDownload/Package.appxmanifest | 4 +- VDownload/Resources/AppProperties.xaml | 9 + VDownload/Resources/Icons.xaml | 38 +++ VDownload/Resources/Images.xaml | 2 + VDownload/Strings/en-US/Resources.resw | 144 +++++++++ VDownload/VDownload.csproj | 55 +++- VDownload/Views/About/MainPage.xaml | 33 +- .../Home/Controls/DownloadTaskControl.xaml.cs | 41 +-- .../Controls/SerialVideoAddingControl.xaml | 4 +- .../Controls/SerialVideoAddingControl.xaml.cs | 11 +- .../Controls/SubscriptionsLoadControl.xaml.cs | 2 + .../VideoAddingOptionsControl.xaml.cs | 7 +- .../Home/SubscriptionsAddingPanel.xaml.cs | 2 +- VDownload/Views/Settings/MainPage.xaml | 155 +++++++++- VDownload/Views/Settings/MainPage.xaml.cs | 286 +++++++++++++++++- 61 files changed, 1004 insertions(+), 144 deletions(-) delete mode 100644 VDownload.Core/EventArgs/DownloadTaskEndedSuccessfullyEventArgs.cs delete mode 100644 VDownload.Core/EventArgs/DownloadTaskEndedUnsuccessfullyEventArgs.cs delete mode 100644 VDownload.Core/EventArgs/DownloadTaskScheduledEventArgs.cs create mode 100644 VDownload.Core/EventArgs/DownloadTaskStatusChangedEventArgs.cs create mode 100644 VDownload/Assets/Icons/ActiveTasksNumberDark.svg create mode 100644 VDownload/Assets/Icons/ActiveTasksNumberLight.svg create mode 100644 VDownload/Assets/Icons/CustomMediaLocationDark.svg create mode 100644 VDownload/Assets/Icons/CustomMediaLocationLight.svg create mode 100644 VDownload/Assets/Icons/DefaultAudioExtensionDark.svg create mode 100644 VDownload/Assets/Icons/DefaultAudioExtensionLight.svg create mode 100644 VDownload/Assets/Icons/DefaultMediaTypeDark.svg create mode 100644 VDownload/Assets/Icons/DefaultMediaTypeLight.svg create mode 100644 VDownload/Assets/Icons/DefaultVideoExtensionDark.svg create mode 100644 VDownload/Assets/Icons/DefaultVideoExtensionLight.svg create mode 100644 VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorDark.svg create mode 100644 VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorLight.svg create mode 100644 VDownload/Assets/Icons/DeleteTemporaryFilesOnStartDark.svg create mode 100644 VDownload/Assets/Icons/DeleteTemporaryFilesOnStartLight.svg create mode 100644 VDownload/Assets/Icons/EditingAlgorithmDark.svg create mode 100644 VDownload/Assets/Icons/EditingAlgorithmLight.svg create mode 100644 VDownload/Assets/Icons/FilenameTemplateDark.svg create mode 100644 VDownload/Assets/Icons/FilenameTemplateLight.svg create mode 100644 VDownload/Assets/Icons/LastMediaLocationDark.svg create mode 100644 VDownload/Assets/Icons/LastMediaLocationLight.svg create mode 100644 VDownload/Assets/Icons/MeteredConnectionDelayDark.svg create mode 100644 VDownload/Assets/Icons/MeteredConnectionDelayLight.svg create mode 100644 VDownload/Assets/Icons/MeteredConnectionWarningDark.svg create mode 100644 VDownload/Assets/Icons/MeteredConnectionWarningLight.svg create mode 100644 VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskDark.svg create mode 100644 VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskLight.svg create mode 100644 VDownload/Assets/Icons/ReplaceFileDark.svg create mode 100644 VDownload/Assets/Icons/ReplaceFileLight.svg create mode 100644 VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulDark.svg create mode 100644 VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulLight.svg create mode 100644 VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulDark.svg create mode 100644 VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulLight.svg create mode 100644 VDownload/Assets/Icons/TemporaryFilesLocationDark.svg create mode 100644 VDownload/Assets/Icons/TemporaryFilesLocationLight.svg create mode 100644 VDownload/Assets/Icons/TranscodingAlgorithmDark.svg create mode 100644 VDownload/Assets/Icons/TranscodingAlgorithmLight.svg create mode 100644 VDownload/Assets/Icons/UseHardwareAccelerationDark.svg create mode 100644 VDownload/Assets/Icons/UseHardwareAccelerationLight.svg create mode 100644 VDownload/Resources/AppProperties.xaml diff --git a/VDownload.Core/EventArgs/DownloadTaskEndedSuccessfullyEventArgs.cs b/VDownload.Core/EventArgs/DownloadTaskEndedSuccessfullyEventArgs.cs deleted file mode 100644 index 9315429..0000000 --- a/VDownload.Core/EventArgs/DownloadTaskEndedSuccessfullyEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace VDownload.Core.EventArgs -{ - public class DownloadTaskEndedSuccessfullyEventArgs : System.EventArgs - { - #region CONSTRUCTORS - - public DownloadTaskEndedSuccessfullyEventArgs(TimeSpan elapsedTime) - { - ElapsedTime = elapsedTime; - } - - #endregion - - - - #region PROPERTIES - - public TimeSpan ElapsedTime { get; private set; } - - #endregion - } -} diff --git a/VDownload.Core/EventArgs/DownloadTaskEndedUnsuccessfullyEventArgs.cs b/VDownload.Core/EventArgs/DownloadTaskEndedUnsuccessfullyEventArgs.cs deleted file mode 100644 index 1d71fab..0000000 --- a/VDownload.Core/EventArgs/DownloadTaskEndedUnsuccessfullyEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace VDownload.Core.EventArgs -{ - public class DownloadTaskEndedUnsuccessfullyEventArgs : System.EventArgs - { - #region CONSTRUCTORS - - public DownloadTaskEndedUnsuccessfullyEventArgs(Exception exception) - { - Exception = exception; - } - - #endregion - - - - #region PROPERTIES - - public Exception Exception { get; private set; } - - #endregion - } -} diff --git a/VDownload.Core/EventArgs/DownloadTaskScheduledEventArgs.cs b/VDownload.Core/EventArgs/DownloadTaskScheduledEventArgs.cs deleted file mode 100644 index e5d4b7e..0000000 --- a/VDownload.Core/EventArgs/DownloadTaskScheduledEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace VDownload.Core.EventArgs -{ - public class DownloadTaskScheduledEventArgs : System.EventArgs - { - #region CONSTRUCTORS - - public DownloadTaskScheduledEventArgs(DateTime scheduledFor) - { - ScheduledFor = scheduledFor; - } - - #endregion - - - - #region PROPERTIES - - public DateTime ScheduledFor { get; private set; } - - #endregion - } -} diff --git a/VDownload.Core/EventArgs/DownloadTaskStatusChangedEventArgs.cs b/VDownload.Core/EventArgs/DownloadTaskStatusChangedEventArgs.cs new file mode 100644 index 0000000..643ced4 --- /dev/null +++ b/VDownload.Core/EventArgs/DownloadTaskStatusChangedEventArgs.cs @@ -0,0 +1,61 @@ +using System; +using VDownload.Core.Enums; + +namespace VDownload.Core.EventArgs +{ + public class DownloadTaskStatusChangedEventArgs : System.EventArgs + { + #region CONSTRUCTORS + + public DownloadTaskStatusChangedEventArgs(DownloadTaskStatus status) + { + Status = status; + } + + public DownloadTaskStatusChangedEventArgs(DownloadTaskStatus status, DateTime scheduledFor) + { + Status = status; + ScheduledFor = scheduledFor; + } + + public DownloadTaskStatusChangedEventArgs(DownloadTaskStatus status, double progress) + { + Status = status; + if (Status == DownloadTaskStatus.Downloading) + { + DownloadingProgress = progress; + } + else if (Status == DownloadTaskStatus.Processing) + { + ProcessingProgress = progress; + } + } + + public DownloadTaskStatusChangedEventArgs(DownloadTaskStatus status, TimeSpan elapsedTime) + { + Status = status; + ElapsedTime = elapsedTime; + } + + public DownloadTaskStatusChangedEventArgs(DownloadTaskStatus status, Exception exception) + { + Status = status; + Exception = exception; + } + + #endregion + + + + #region PROPERTIES + + public DownloadTaskStatus Status { get; private set; } + public DateTime ScheduledFor { get; private set; } + public double DownloadingProgress { get; private set; } + public double ProcessingProgress { get; private set; } + public TimeSpan ElapsedTime { get; private set; } + public Exception Exception { get; private set; } + + #endregion + } +} diff --git a/VDownload.Core/Services/Config.cs b/VDownload.Core/Services/Config.cs index d276d4f..0dc542d 100644 --- a/VDownload.Core/Services/Config.cs +++ b/VDownload.Core/Services/Config.cs @@ -26,7 +26,6 @@ namespace VDownload.Core.Services { "default_video_extension", (int)VideoFileExtension.MP4 }, { "default_audio_extension", (int)AudioFileExtension.MP3 }, { "custom_media_location", false }, - { "custom_temp_location", false }, { "max_active_video_task", 5 }, { "replace_output_file_if_exists", false }, { "remove_task_when_successfully_ended", false }, diff --git a/VDownload.Core/Services/DownloadTask.cs b/VDownload.Core/Services/DownloadTask.cs index 4a38e61..8f69415 100644 --- a/VDownload.Core/Services/DownloadTask.cs +++ b/VDownload.Core/Services/DownloadTask.cs @@ -27,6 +27,7 @@ namespace VDownload.Core.Structs Schedule = schedule; Status = DownloadTaskStatus.Idle; + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status); CancellationTokenSource = new CancellationTokenSource(); } @@ -44,14 +45,9 @@ namespace VDownload.Core.Structs public OutputFile File { get; set; } public double Schedule { get; set; } public DownloadTaskStatus Status { get; private set; } + public DownloadTaskStatusChangedEventArgs LastStatusChangedEventArgs { get; private set; } public CancellationTokenSource CancellationTokenSource { get; private set; } - public DateTime ScheduledFor { get; private set; } - public double DownloadingProgress { get; private set; } - public double ProcessingProgress { get; private set; } - public TimeSpan ElapsedTime { get; private set; } - public Exception Exception { get; private set; } - #endregion @@ -60,30 +56,35 @@ namespace VDownload.Core.Structs public async Task Run(bool delayWhenOnMeteredConnection) { - StatusChanged.Invoke(this, System.EventArgs.Empty); + StatusChanged.Invoke(this, new DownloadTaskStatusChangedEventArgs(Status)); CancellationTokenSource = new CancellationTokenSource(); if (Schedule > 0) { - ScheduledFor = DateTime.Now.AddMinutes(Schedule); + DateTime scheduleFor = DateTime.Now.AddMinutes(Schedule); Status = DownloadTaskStatus.Scheduled; - StatusChanged.Invoke(this, System.EventArgs.Empty); - while (DateTime.Now < ScheduledFor && !CancellationTokenSource.Token.IsCancellationRequested) await Task.Delay(100); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, scheduleFor); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); + while (DateTime.Now < scheduleFor && !CancellationTokenSource.Token.IsCancellationRequested) + { + await Task.Delay(100); + } } Status = DownloadTaskStatus.Queued; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); await DownloadTasksCollectionManagement.WaitInQueue(delayWhenOnMeteredConnection, CancellationTokenSource.Token); if (!CancellationTokenSource.Token.IsCancellationRequested) { - DownloadingProgress = 0; Status = DownloadTaskStatus.Downloading; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, 0); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); StorageFolder tempFolder; - if ((bool)Config.GetValue("custom_temp_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_temp_location")) + if (StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_temp_location")) { tempFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("custom_temp_location"); } @@ -112,7 +113,8 @@ namespace VDownload.Core.Structs session.Dispose(); Status = DownloadTaskStatus.Finalizing; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); StorageFile outputFile = await File.Create(); @@ -121,16 +123,16 @@ namespace VDownload.Core.Structs taskStopwatch.Stop(); - ElapsedTime = taskStopwatch.Elapsed; Status = DownloadTaskStatus.EndedSuccessfully; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, taskStopwatch.Elapsed); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); } catch (Exception ex) { endedWithError = true; - Exception = ex; Status = DownloadTaskStatus.EndedUnsuccessfully; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, ex); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); } finally { @@ -143,24 +145,24 @@ namespace VDownload.Core.Structs } else { - Exception = new OperationCanceledException(CancellationTokenSource.Token); Status = DownloadTaskStatus.EndedUnsuccessfully; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, new OperationCanceledException(CancellationTokenSource.Token)); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); } } private void DownloadingProgressChanged(object sender, ProgressChangedEventArgs e) { - DownloadingProgress = e.Progress; Status = DownloadTaskStatus.Downloading; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, e.Progress); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); } private void ProcessingProgressChanged(object sender, ProgressChangedEventArgs e) { - ProcessingProgress = e.Progress; Status = DownloadTaskStatus.Processing; - StatusChanged.Invoke(this, System.EventArgs.Empty); + LastStatusChangedEventArgs = new DownloadTaskStatusChangedEventArgs(Status, e.Progress); + StatusChanged.Invoke(this, LastStatusChangedEventArgs); } #endregion @@ -169,7 +171,7 @@ namespace VDownload.Core.Structs #region EVENT - public event EventHandler StatusChanged; + public event EventHandler StatusChanged; #endregion } diff --git a/VDownload.Core/VDownload.Core.csproj b/VDownload.Core/VDownload.Core.csproj index 5c1eb71..b879400 100644 --- a/VDownload.Core/VDownload.Core.csproj +++ b/VDownload.Core/VDownload.Core.csproj @@ -128,11 +128,9 @@ - - - - + + diff --git a/VDownload/App.xaml.cs b/VDownload/App.xaml.cs index 04d3cdb..539eb27 100644 --- a/VDownload/App.xaml.cs +++ b/VDownload/App.xaml.cs @@ -35,14 +35,13 @@ namespace VDownload protected override async void OnLaunched(LaunchActivatedEventArgs e) { // Rebuild configuration file - //Config.Rebuild(); - Config.SetDefault(); + Config.Rebuild(); // Delete temp on start if ((bool)Config.GetValue("delete_temp_on_start")) { IReadOnlyList tempItems; - if ((bool)Config.GetValue("custom_temp_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_temp_location")) + if (StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_temp_location")) tempItems = await (await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("custom_temp_location")).GetItemsAsync(); else tempItems = await ApplicationData.Current.TemporaryFolder.GetItemsAsync(); diff --git a/VDownload/Assets/Icons/ActiveTasksNumberDark.svg b/VDownload/Assets/Icons/ActiveTasksNumberDark.svg new file mode 100644 index 0000000..22a9127 --- /dev/null +++ b/VDownload/Assets/Icons/ActiveTasksNumberDark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ActiveTasksNumberLight.svg b/VDownload/Assets/Icons/ActiveTasksNumberLight.svg new file mode 100644 index 0000000..ea4876d --- /dev/null +++ b/VDownload/Assets/Icons/ActiveTasksNumberLight.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/CustomMediaLocationDark.svg b/VDownload/Assets/Icons/CustomMediaLocationDark.svg new file mode 100644 index 0000000..30bd99c --- /dev/null +++ b/VDownload/Assets/Icons/CustomMediaLocationDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/CustomMediaLocationLight.svg b/VDownload/Assets/Icons/CustomMediaLocationLight.svg new file mode 100644 index 0000000..f57e1b6 --- /dev/null +++ b/VDownload/Assets/Icons/CustomMediaLocationLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultAudioExtensionDark.svg b/VDownload/Assets/Icons/DefaultAudioExtensionDark.svg new file mode 100644 index 0000000..9a429fe --- /dev/null +++ b/VDownload/Assets/Icons/DefaultAudioExtensionDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultAudioExtensionLight.svg b/VDownload/Assets/Icons/DefaultAudioExtensionLight.svg new file mode 100644 index 0000000..522d165 --- /dev/null +++ b/VDownload/Assets/Icons/DefaultAudioExtensionLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultMediaTypeDark.svg b/VDownload/Assets/Icons/DefaultMediaTypeDark.svg new file mode 100644 index 0000000..b711faa --- /dev/null +++ b/VDownload/Assets/Icons/DefaultMediaTypeDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultMediaTypeLight.svg b/VDownload/Assets/Icons/DefaultMediaTypeLight.svg new file mode 100644 index 0000000..956bd74 --- /dev/null +++ b/VDownload/Assets/Icons/DefaultMediaTypeLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultVideoExtensionDark.svg b/VDownload/Assets/Icons/DefaultVideoExtensionDark.svg new file mode 100644 index 0000000..56ab229 --- /dev/null +++ b/VDownload/Assets/Icons/DefaultVideoExtensionDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DefaultVideoExtensionLight.svg b/VDownload/Assets/Icons/DefaultVideoExtensionLight.svg new file mode 100644 index 0000000..48afad2 --- /dev/null +++ b/VDownload/Assets/Icons/DefaultVideoExtensionLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorDark.svg b/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorDark.svg new file mode 100644 index 0000000..09f6159 --- /dev/null +++ b/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorLight.svg b/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorLight.svg new file mode 100644 index 0000000..37dad85 --- /dev/null +++ b/VDownload/Assets/Icons/DeleteTasksTemporaryFilesIfEndedWithErrorLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartDark.svg b/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartDark.svg new file mode 100644 index 0000000..60e3d88 --- /dev/null +++ b/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartLight.svg b/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartLight.svg new file mode 100644 index 0000000..68bfbb3 --- /dev/null +++ b/VDownload/Assets/Icons/DeleteTemporaryFilesOnStartLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/EditingAlgorithmDark.svg b/VDownload/Assets/Icons/EditingAlgorithmDark.svg new file mode 100644 index 0000000..6b7142c --- /dev/null +++ b/VDownload/Assets/Icons/EditingAlgorithmDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/EditingAlgorithmLight.svg b/VDownload/Assets/Icons/EditingAlgorithmLight.svg new file mode 100644 index 0000000..0b7d608 --- /dev/null +++ b/VDownload/Assets/Icons/EditingAlgorithmLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/FilenameTemplateDark.svg b/VDownload/Assets/Icons/FilenameTemplateDark.svg new file mode 100644 index 0000000..33926df --- /dev/null +++ b/VDownload/Assets/Icons/FilenameTemplateDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/FilenameTemplateLight.svg b/VDownload/Assets/Icons/FilenameTemplateLight.svg new file mode 100644 index 0000000..3a9a9a9 --- /dev/null +++ b/VDownload/Assets/Icons/FilenameTemplateLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/LastMediaLocationDark.svg b/VDownload/Assets/Icons/LastMediaLocationDark.svg new file mode 100644 index 0000000..26f50d6 --- /dev/null +++ b/VDownload/Assets/Icons/LastMediaLocationDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/LastMediaLocationLight.svg b/VDownload/Assets/Icons/LastMediaLocationLight.svg new file mode 100644 index 0000000..5917c91 --- /dev/null +++ b/VDownload/Assets/Icons/LastMediaLocationLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/MeteredConnectionDelayDark.svg b/VDownload/Assets/Icons/MeteredConnectionDelayDark.svg new file mode 100644 index 0000000..b2fcf09 --- /dev/null +++ b/VDownload/Assets/Icons/MeteredConnectionDelayDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/MeteredConnectionDelayLight.svg b/VDownload/Assets/Icons/MeteredConnectionDelayLight.svg new file mode 100644 index 0000000..960e876 --- /dev/null +++ b/VDownload/Assets/Icons/MeteredConnectionDelayLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/MeteredConnectionWarningDark.svg b/VDownload/Assets/Icons/MeteredConnectionWarningDark.svg new file mode 100644 index 0000000..c3547af --- /dev/null +++ b/VDownload/Assets/Icons/MeteredConnectionWarningDark.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/MeteredConnectionWarningLight.svg b/VDownload/Assets/Icons/MeteredConnectionWarningLight.svg new file mode 100644 index 0000000..afbe339 --- /dev/null +++ b/VDownload/Assets/Icons/MeteredConnectionWarningLight.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskDark.svg b/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskDark.svg new file mode 100644 index 0000000..c4ec375 --- /dev/null +++ b/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskLight.svg b/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskLight.svg new file mode 100644 index 0000000..ad6d56e --- /dev/null +++ b/VDownload/Assets/Icons/RemoveSuccessfullyEndedTaskLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ReplaceFileDark.svg b/VDownload/Assets/Icons/ReplaceFileDark.svg new file mode 100644 index 0000000..be40b2d --- /dev/null +++ b/VDownload/Assets/Icons/ReplaceFileDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ReplaceFileLight.svg b/VDownload/Assets/Icons/ReplaceFileLight.svg new file mode 100644 index 0000000..e16aab7 --- /dev/null +++ b/VDownload/Assets/Icons/ReplaceFileLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulDark.svg b/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulDark.svg new file mode 100644 index 0000000..749f2be --- /dev/null +++ b/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulDark.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulLight.svg b/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulLight.svg new file mode 100644 index 0000000..5b32503 --- /dev/null +++ b/VDownload/Assets/Icons/ShowNotifcationWhenSuccessfulLight.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulDark.svg b/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulDark.svg new file mode 100644 index 0000000..f7722c3 --- /dev/null +++ b/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulDark.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulLight.svg b/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulLight.svg new file mode 100644 index 0000000..4999e02 --- /dev/null +++ b/VDownload/Assets/Icons/ShowNotifcationWhenUnsuccessfulLight.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/TemporaryFilesLocationDark.svg b/VDownload/Assets/Icons/TemporaryFilesLocationDark.svg new file mode 100644 index 0000000..443feae --- /dev/null +++ b/VDownload/Assets/Icons/TemporaryFilesLocationDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/TemporaryFilesLocationLight.svg b/VDownload/Assets/Icons/TemporaryFilesLocationLight.svg new file mode 100644 index 0000000..0d8d098 --- /dev/null +++ b/VDownload/Assets/Icons/TemporaryFilesLocationLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/TranscodingAlgorithmDark.svg b/VDownload/Assets/Icons/TranscodingAlgorithmDark.svg new file mode 100644 index 0000000..47667fe --- /dev/null +++ b/VDownload/Assets/Icons/TranscodingAlgorithmDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/TranscodingAlgorithmLight.svg b/VDownload/Assets/Icons/TranscodingAlgorithmLight.svg new file mode 100644 index 0000000..ddb5555 --- /dev/null +++ b/VDownload/Assets/Icons/TranscodingAlgorithmLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/UseHardwareAccelerationDark.svg b/VDownload/Assets/Icons/UseHardwareAccelerationDark.svg new file mode 100644 index 0000000..126e0b9 --- /dev/null +++ b/VDownload/Assets/Icons/UseHardwareAccelerationDark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Assets/Icons/UseHardwareAccelerationLight.svg b/VDownload/Assets/Icons/UseHardwareAccelerationLight.svg new file mode 100644 index 0000000..4a53e9e --- /dev/null +++ b/VDownload/Assets/Icons/UseHardwareAccelerationLight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/VDownload/Package.appxmanifest b/VDownload/Package.appxmanifest index 95d601d..4bdde34 100644 --- a/VDownload/Package.appxmanifest +++ b/VDownload/Package.appxmanifest @@ -8,8 +8,8 @@ + Publisher="CN=Mateusz Skoczek" + Version="0.1.0.0" /> diff --git a/VDownload/Resources/AppProperties.xaml b/VDownload/Resources/AppProperties.xaml new file mode 100644 index 0000000..a74515d --- /dev/null +++ b/VDownload/Resources/AppProperties.xaml @@ -0,0 +1,9 @@ + + VDownload + 1.0-prerelease1 + Mateusz Skoczek + https://github.com/mateuszskoczek/VDownload + https://paypal.me/mateuszskoczek + diff --git a/VDownload/Resources/Icons.xaml b/VDownload/Resources/Icons.xaml index eab70bc..be0b36c 100644 --- a/VDownload/Resources/Icons.xaml +++ b/VDownload/Resources/Icons.xaml @@ -24,6 +24,25 @@ + + + + + + + + + + + + + + + + + + + @@ -47,6 +66,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/VDownload/Resources/Images.xaml b/VDownload/Resources/Images.xaml index 8829843..0bd1c60 100644 --- a/VDownload/Resources/Images.xaml +++ b/VDownload/Resources/Images.xaml @@ -1,6 +1,8 @@  + + diff --git a/VDownload/Strings/en-US/Resources.resw b/VDownload/Strings/en-US/Resources.resw index 0e91ebb..0cb5181 100644 --- a/VDownload/Strings/en-US/Resources.resw +++ b/VDownload/Strings/en-US/Resources.resw @@ -379,4 +379,148 @@ The number in the numberbox indicades how many videos will be got from playlist. Settings + + Downloading tasks + + + Maximum number of active downloading tasks + + + Default audio files extension + + + Custom location + + + Browse + + + Default media type + + + Filename template + + + <title> - Title +<author> - Author +<views> - Views +<id> - Video ID +<date_pub:format> - Publication date +<date_now:format> - Actual date +<duration:format> - Video duration + + + Filename template + + + Default downloading task settings + + + Otherwise, the location given below will be used + + + Remeber last used location + + + Default video files extension + + + Delay when queued task starts on metered connection + + + Remove successfully ended task + + + Replace output file if exists + + + Show warning when task starts on metered connection + + + Notifications + + + Show notification when task ended successfully + + + Show notification when task ended unsuccessfully + + + Editing algorithm + + + Processing + + + Transcoding algorithm + + + Use hardware acceleration + + + Delete task's temporary files if ended with error + + + Delete all temporary files on start + + + Temporary files + + + Temporary files location + + + Browse + + + Twitch + + + Skip downloading chunks that are out of trimming bounds + + + Passive VOD trimming + + + VOD chunk downloading error - maximum number of retries + + + Delay between retries in miliseconds + + + VOD chunk downloading error - delay between retries + + + VOD chunk downloading error - retry after error + + + Links + + + Developer + + + Donation + + + Repository + + + Mateusz Skoczek + + + Translated into English by + + + Restore default settings + + + Otherwise, new filename will be generated (example: original_filename (1)) + + + Editing mode is used when download task requires merging audio & video separate channels + + + Transcoding mode is used when download task only requires file conversion + \ No newline at end of file diff --git a/VDownload/VDownload.csproj b/VDownload/VDownload.csproj index 0f18545..62044fb 100644 --- a/VDownload/VDownload.csproj +++ b/VDownload/VDownload.csproj @@ -17,7 +17,15 @@ 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} true - false + True + False + False + True + Always + x64 + 0 + 19004779324CA6C66C5D4549F0161C153221ABD8 + SHA256 true @@ -186,27 +194,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -225,9 +265,15 @@ + + + + + + @@ -294,6 +340,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -415,6 +465,9 @@ + + + 14.0 diff --git a/VDownload/Views/About/MainPage.xaml b/VDownload/Views/About/MainPage.xaml index 0540ae9..6c47b00 100644 --- a/VDownload/Views/About/MainPage.xaml +++ b/VDownload/Views/About/MainPage.xaml @@ -8,7 +8,36 @@ mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + diff --git a/VDownload/Views/Home/Controls/DownloadTaskControl.xaml.cs b/VDownload/Views/Home/Controls/DownloadTaskControl.xaml.cs index c74096a..06a743a 100644 --- a/VDownload/Views/Home/Controls/DownloadTaskControl.xaml.cs +++ b/VDownload/Views/Home/Controls/DownloadTaskControl.xaml.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using VDownload.Core.Enums; +using VDownload.Core.EventArgs; using VDownload.Core.Extensions; using VDownload.Core.Services; using VDownload.Core.Structs; @@ -64,7 +65,7 @@ namespace VDownload.Views.Home.Controls File = DownloadTask.File.GetPath(); - UpdateStatus(this, EventArgs.Empty); + UpdateStatus(this, DownloadTask.LastStatusChangedEventArgs); } #endregion @@ -133,9 +134,9 @@ namespace VDownload.Views.Home.Controls await Windows.System.Launcher.LaunchUriAsync(DownloadTask.Video.Url); } - private void UpdateStatus(object sender, EventArgs e) + private void UpdateStatus(object sender, DownloadTaskStatusChangedEventArgs e) { - if (DownloadTask.Status == DownloadTaskStatus.Idle || DownloadTask.Status == DownloadTaskStatus.EndedSuccessfully || DownloadTask.Status == DownloadTaskStatus.EndedUnsuccessfully) + if (e.Status == DownloadTaskStatus.Idle || e.Status == DownloadTaskStatus.EndedSuccessfully || e.Status == DownloadTaskStatus.EndedUnsuccessfully) { StartStopButton.Icon = new SymbolIcon(Symbol.Download); } @@ -144,46 +145,46 @@ namespace VDownload.Views.Home.Controls StartStopButton.Icon = new SymbolIcon(Symbol.Stop); } - if (DownloadTask.Status == DownloadTaskStatus.Scheduled) + if (e.Status == DownloadTaskStatus.Scheduled) { StateIcon.Source = (SvgImageSource)IconsRes["StateScheduledIcon"]; - StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Scheduled")} ({DownloadTask.ScheduledFor.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortDatePattern)} {DownloadTask.ScheduledFor.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortTimePattern)})"; + StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Scheduled")} ({e.ScheduledFor.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortDatePattern)} {e.ScheduledFor.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortTimePattern)})"; StateProgressBar.Visibility = Visibility.Collapsed; } - else if (DownloadTask.Status == DownloadTaskStatus.Queued) + else if (e.Status == DownloadTaskStatus.Queued) { StateIcon.Source = (SvgImageSource)IconsRes["StateQueuedIcon"]; StateText.Text = ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Queued"); StateProgressBar.Visibility = Visibility.Visible; StateProgressBar.IsIndeterminate = true; } - else if (DownloadTask.Status == DownloadTaskStatus.Downloading) + else if (e.Status == DownloadTaskStatus.Downloading) { StateIcon.Source = (SvgImageSource)IconsRes["StateDownloadingIcon"]; - StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Downloading")} ({Math.Round(DownloadTask.DownloadingProgress)}%)"; + StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Downloading")} ({Math.Round(e.DownloadingProgress)}%)"; StateProgressBar.Visibility = Visibility.Visible; StateProgressBar.IsIndeterminate = false; - StateProgressBar.Value = DownloadTask.DownloadingProgress; + StateProgressBar.Value = e.DownloadingProgress; } - else if (DownloadTask.Status == DownloadTaskStatus.Processing) + else if (e.Status == DownloadTaskStatus.Processing) { StateIcon.Source = (SvgImageSource)IconsRes["StateProcessingIcon"]; - StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Processing")} ({Math.Round(DownloadTask.ProcessingProgress)}%)"; + StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Processing")} ({Math.Round(e.ProcessingProgress)}%)"; StateProgressBar.Visibility = Visibility.Visible; StateProgressBar.IsIndeterminate = false; - StateProgressBar.Value = DownloadTask.ProcessingProgress; + StateProgressBar.Value = e.ProcessingProgress; } - else if (DownloadTask.Status == DownloadTaskStatus.Finalizing) + else if (e.Status == DownloadTaskStatus.Finalizing) { StateIcon.Source = (SvgImageSource)IconsRes["StateFinalizingIcon"]; StateText.Text = ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Finalizing"); StateProgressBar.Visibility = Visibility.Visible; StateProgressBar.IsIndeterminate = true; } - else if (DownloadTask.Status == DownloadTaskStatus.EndedSuccessfully) + else if (e.Status == DownloadTaskStatus.EndedSuccessfully) { StateIcon.Source = (SvgImageSource)IconsRes["StateDoneIcon"]; - StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Done")} ({DownloadTask.ElapsedTime.ToStringOptTHBaseMMSS()})"; + StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Done")} ({e.ElapsedTime.ToStringOptTHBaseMMSS()})"; StateProgressBar.Visibility = Visibility.Collapsed; if ((bool)Config.GetValue("show_notification_when_task_ended_successfully")) @@ -194,9 +195,9 @@ namespace VDownload.Views.Home.Controls .Show(); } } - else if (DownloadTask.Status == DownloadTaskStatus.EndedUnsuccessfully) + else if (e.Status == DownloadTaskStatus.EndedUnsuccessfully) { - if (DownloadTask.Exception is OperationCanceledException) + if (e.Exception is OperationCanceledException) { StateIcon.Source = (SvgImageSource)IconsRes["StateCancelledIcon"]; StateText.Text = ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Cancelled"); @@ -205,14 +206,14 @@ namespace VDownload.Views.Home.Controls else { string errorInfo; - if (DownloadTask.Exception is WebException) + if (e.Exception is WebException) { if (!NetworkHelper.Instance.ConnectionInformation.IsInternetAvailable) errorInfo = ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_Error_InternetNotAvailable"); - else throw DownloadTask.Exception; + else throw e.Exception; } else { - throw DownloadTask.Exception; + throw e.Exception; } StateIcon.Source = (SvgImageSource)IconsRes["StateErrorIcon"]; StateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("Home_DownloadTaskControl_State_Error")} ({errorInfo})"; diff --git a/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml b/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml index e9643ca..97e6e2f 100644 --- a/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml +++ b/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml @@ -113,9 +113,9 @@ - + - + diff --git a/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml.cs b/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml.cs index 27111ec..21ee9a0 100644 --- a/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml.cs +++ b/VDownload/Views/Home/Controls/SerialVideoAddingControl.xaml.cs @@ -126,7 +126,7 @@ namespace VDownload.Views.Home.Controls } else if ((bool)Config.GetValue("custom_media_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_media_location")) { - ApplyToAllLocation = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("selected_media_location"); + ApplyToAllLocation = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("custom_media_location"); ApplyToAllLocationSettingControl.Description = ApplyToAllLocation.Path; } else @@ -226,7 +226,7 @@ namespace VDownload.Views.Home.Controls FilterChanged(); } - private void FilterMinAndMaxDateDatePicker_LostFocus(object sender, RoutedEventArgs args) + private void FilterMinAndMaxDateDatePicker_DateChanged(CalendarDatePicker sender, CalendarDatePickerDateChangedEventArgs args) { FilterChanged(); } @@ -320,7 +320,10 @@ namespace VDownload.Views.Home.Controls catch (ArgumentException) { } List allVideos = new List(); - allVideos.AddRange((IEnumerable)(VideosStackPanel.Children.ToList())); + foreach (SerialVideoAddingVideoControl video in VideosStackPanel.Children) + { + allVideos.Add(video); + } allVideos.AddRange(HiddenVideos); VideosStackPanel.Children.Clear(); HiddenVideos.Clear(); @@ -338,7 +341,7 @@ namespace VDownload.Views.Home.Controls ) HiddenVideos.Add(videoControl); else VideosStackPanel.Children.Add(videoControl); } - FilterHeaderCountTextBlock.Text = HiddenVideos.Count + DeletedVideos.Count > 0 ? $"{ResourceLoader.GetForCurrentView().GetString("HomePlaylistAddingPanelFilterHeaderCountTextBlockPrefix")}: {HiddenVideos.Count + DeletedVideos.Count}" : string.Empty; + FilterHeaderCountTextBlock.Text = HiddenVideos.Count + DeletedVideos.Count > 0 ? $"{ResourceLoader.GetForCurrentView().GetString("Home_Adding_Base_SerialVideoAddingControl_Filter_Header_CountTextBlockPrefix")}: {HiddenVideos.Count + DeletedVideos.Count}" : string.Empty; } #endregion diff --git a/VDownload/Views/Home/Controls/SubscriptionsLoadControl.xaml.cs b/VDownload/Views/Home/Controls/SubscriptionsLoadControl.xaml.cs index 54829b2..8b15f96 100644 --- a/VDownload/Views/Home/Controls/SubscriptionsLoadControl.xaml.cs +++ b/VDownload/Views/Home/Controls/SubscriptionsLoadControl.xaml.cs @@ -144,6 +144,8 @@ namespace VDownload.Views.Home.Controls } LoadingSuccessed.Invoke(this, new SubscriptionLoadSuccessedEventArgs(loadedVideos.ToArray())); + + ProgressRing.Visibility = Visibility.Collapsed; } #endregion diff --git a/VDownload/Views/Home/Controls/VideoAddingOptionsControl.xaml.cs b/VDownload/Views/Home/Controls/VideoAddingOptionsControl.xaml.cs index b83f907..70ba4f2 100644 --- a/VDownload/Views/Home/Controls/VideoAddingOptionsControl.xaml.cs +++ b/VDownload/Views/Home/Controls/VideoAddingOptionsControl.xaml.cs @@ -142,7 +142,7 @@ namespace VDownload.Views.Home.Controls } else if ((bool)Config.GetValue("custom_media_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_media_location")) { - FileLocation = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("selected_media_location"); + FileLocation = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("custom_media_location"); FileLocationSettingControl.Description = FileLocation.Path; } else @@ -271,7 +271,10 @@ namespace VDownload.Views.Home.Controls private void ScheduleSettingControlNumberBox_LostFocus(object sender, RoutedEventArgs e) { - if (((NumberBox)sender).Value == double.NaN) ((NumberBox)sender).Value = 0; + if (((NumberBox)sender).Value == double.NaN) + { + ((NumberBox)sender).Value = 0; + } Schedule = ((NumberBox)sender).Value; } diff --git a/VDownload/Views/Home/SubscriptionsAddingPanel.xaml.cs b/VDownload/Views/Home/SubscriptionsAddingPanel.xaml.cs index bf0b141..c2be98b 100644 --- a/VDownload/Views/Home/SubscriptionsAddingPanel.xaml.cs +++ b/VDownload/Views/Home/SubscriptionsAddingPanel.xaml.cs @@ -76,7 +76,7 @@ namespace VDownload.Views.Home tasksList.Add(new DownloadTask(id, videoControl.Video, videoControl.OptionsControl.MediaType, videoControl.OptionsControl.Stream, trim, file, videoControl.OptionsControl.Schedule)); } - TasksAddingRequested?.Invoke(this, new DownloadTasksAddingRequestedEventArgs(tasksList.ToArray(), DownloadTasksAddingRequestSource.Playlist)); + TasksAddingRequested?.Invoke(this, new DownloadTasksAddingRequestedEventArgs(tasksList.ToArray(), DownloadTasksAddingRequestSource.Subscriptions)); } #endregion diff --git a/VDownload/Views/Settings/MainPage.xaml b/VDownload/Views/Settings/MainPage.xaml index d7fd359..de627b7 100644 --- a/VDownload/Views/Settings/MainPage.xaml +++ b/VDownload/Views/Settings/MainPage.xaml @@ -5,10 +5,19 @@ xmlns:local="using:VDownload.Views.Settings" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:cc="using:VDownload.Controls" + xmlns:cc="using:VDownload.Controls" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + + + + + + + @@ -18,8 +27,148 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +