diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw
index 2deb893..08fb142 100644
--- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw
+++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw
@@ -117,6 +117,15 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Only audio
+
+
+ Only video
+
+
+ Original
+
You are trying to download a video using a metered connection. Do you want to continue?
diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeDownloadsViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeDownloadsViewResources.resw
index 3867e3d..f6b9601 100644
--- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeDownloadsViewResources.resw
+++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeDownloadsViewResources.resw
@@ -117,15 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Only audio
-
-
- Only video
-
-
- Original
-
Cancelled
diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomePlaylistViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomePlaylistViewResources.resw
index 874d57f..512a21d 100644
--- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomePlaylistViewResources.resw
+++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomePlaylistViewResources.resw
@@ -180,15 +180,6 @@
Media options
-
- Only audio
-
-
- Only video
-
-
- Original
-
Media type
diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeVideoViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeVideoViewResources.resw
index b8b8cf7..5e860a6 100644
--- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeVideoViewResources.resw
+++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/HomeVideoViewResources.resw
@@ -144,15 +144,6 @@
Media options
-
- Only audio
-
-
- Only video
-
-
- Original
-
Media type
diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw
index 8b0e6f4..6d25d00 100644
--- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw
+++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw
@@ -129,6 +129,39 @@
Default number of videos fetched from playlist
+
+ Audio extension
+
+
+ Default media options
+
+
+ Default output directory
+
+
+ Browse
+
+
+ Filename template
+
+
+ Tasks
+
+
+ Media type
+
+
+ Maximum number of tasks running in parallel
+
+
+ Otherwise, default directory defined below will be used
+
+
+ Save last output directory
+
+
+ Video extension
+
Twitch
diff --git a/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs
index 8315d0f..9666315 100644
--- a/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs
+++ b/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs
@@ -1,18 +1,26 @@
using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using VDownload.Models;
+using VDownload.Services.Data.Configuration;
using VDownload.Services.Data.Settings;
+using VDownload.Services.UI.StoragePicker;
+using VDownload.Services.UI.StringResources;
namespace VDownload.Core.ViewModels.Settings
{
- public class SettingsViewModel : ObservableObject
+ public partial class SettingsViewModel : ObservableObject
{
#region SERVICES
protected readonly ISettingsService _settingsService;
+ protected readonly IConfigurationService _configurationService;
+ protected readonly IStringResourcesService _stringResourcesService;
+ protected readonly IStoragePickerService _storagePickerService;
#endregion
@@ -26,6 +34,48 @@ namespace VDownload.Core.ViewModels.Settings
set => SetProperty(_settingsService.Data.Common.Searching.MaxNumberOfVideosToGetFromPlaylist, value, _settingsService.Data.Common.Searching, (u, n) => u.MaxNumberOfVideosToGetFromPlaylist = n);
}
+ public int TasksRunningTasks
+ {
+ get => _settingsService.Data.Common.Tasks.MaxNumberOfRunningTasks;
+ set => SetProperty(_settingsService.Data.Common.Tasks.MaxNumberOfRunningTasks, value, _settingsService.Data.Common.Tasks, (u, n) => u.MaxNumberOfRunningTasks = n);
+ }
+
+ public MediaType TasksMediaType
+ {
+ get => _settingsService.Data.Common.Tasks.DefaultMediaType;
+ set => SetProperty(_settingsService.Data.Common.Tasks.DefaultMediaType, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultMediaType = n);
+ }
+
+ public VideoExtension TasksVideoExtension
+ {
+ get => _settingsService.Data.Common.Tasks.DefaultVideoExtension;
+ set => SetProperty(_settingsService.Data.Common.Tasks.DefaultVideoExtension, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultVideoExtension = n);
+ }
+
+ public AudioExtension TasksAudioExtension
+ {
+ get => _settingsService.Data.Common.Tasks.DefaultAudioExtension;
+ set => SetProperty(_settingsService.Data.Common.Tasks.DefaultAudioExtension, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultAudioExtension = n);
+ }
+
+ public string TasksFilenameTemplate
+ {
+ get => _settingsService.Data.Common.Tasks.FilenameTemplate;
+ set => SetProperty(_settingsService.Data.Common.Tasks.FilenameTemplate, value, _settingsService.Data.Common.Tasks, (u, n) => u.FilenameTemplate = n);
+ }
+
+ public bool TasksSaveLastOutputDirectory
+ {
+ get => _settingsService.Data.Common.Tasks.SaveLastOutputDirectory;
+ set => SetProperty(_settingsService.Data.Common.Tasks.SaveLastOutputDirectory, value, _settingsService.Data.Common.Tasks, (u, n) => u.SaveLastOutputDirectory = n);
+ }
+
+ public string TasksDefaultOutputDirectory
+ {
+ get => _settingsService.Data.Common.Tasks.DefaultOutputDirectory;
+ set => SetProperty(_settingsService.Data.Common.Tasks.DefaultOutputDirectory, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultOutputDirectory = n);
+ }
+
public bool TwitchVodPassiveTrimming
{
get => _settingsService.Data.Twitch.Vod.PassiveTrimming;
@@ -56,17 +106,41 @@ namespace VDownload.Core.ViewModels.Settings
set => SetProperty(_settingsService.Data.Twitch.Vod.ChunkDownloadingError.RetryDelay, value, _settingsService.Data.Twitch.Vod.ChunkDownloadingError, (u, n) => u.RetryDelay = n);
}
+ [ObservableProperty]
+ protected string _tasksFilenameTemplateTooltip;
+
#endregion
#region CONSTRUCTORS
- public SettingsViewModel(ISettingsService settingsService)
+ public SettingsViewModel(ISettingsService settingsService, IConfigurationService configurationService, IStringResourcesService stringResourcesService, IStoragePickerService storagePickerService)
{
_settingsService = settingsService;
+ _configurationService = configurationService;
+ _stringResourcesService = stringResourcesService;
+ _storagePickerService = storagePickerService;
base.PropertyChanged += PropertyChangedEventHandler;
+
+ _tasksFilenameTemplateTooltip = string.Join('\n', _configurationService.Common.FilenameTemplates.Select(x => _stringResourcesService.FilenameTemplateResources.Get(x.Name)));
+ }
+
+ #endregion
+
+
+
+ #region COMMANDS
+
+ [RelayCommand]
+ public async Task BrowseTasksDefaultOutputDirectory()
+ {
+ string? newDirectory = await _storagePickerService.OpenDirectory();
+ if (newDirectory is not null)
+ {
+ this.TasksDefaultOutputDirectory = newDirectory;
+ }
}
#endregion
diff --git a/VDownload.Core/VDownload.Core.Views/BaseWindow.xaml.cs b/VDownload.Core/VDownload.Core.Views/BaseWindow.xaml.cs
index c6dcf97..ade7603 100644
--- a/VDownload.Core/VDownload.Core.Views/BaseWindow.xaml.cs
+++ b/VDownload.Core/VDownload.Core.Views/BaseWindow.xaml.cs
@@ -1,3 +1,5 @@
+using Microsoft.UI;
+using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
@@ -39,6 +41,7 @@ namespace VDownload.Core.Views
public BaseWindow(BaseViewModel viewModel)
{
this.InitializeComponent();
+ this.Activated += BaseWindow_Activated;
this.ExtendsContentIntoTitleBar = true;
this.SetTitleBar(this.AppTitleBar);
@@ -54,6 +57,14 @@ namespace VDownload.Core.Views
private void Root_Loaded(object sender, RoutedEventArgs e) => RootLoaded?.Invoke(this, EventArgs.Empty);
+ private void BaseWindow_Activated(object sender, WindowActivatedEventArgs args)
+ {
+ IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(this);
+ WindowId windowId = Win32Interop.GetWindowIdFromWindow(windowHandle);
+ AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
+ appWindow.SetIcon(@"Assets\Logo\Logo.ico");
+ }
+
#endregion
}
}
diff --git a/VDownload.Core/VDownload.Core.Views/Home/HomeDownloadsView.xaml b/VDownload.Core/VDownload.Core.Views/Home/HomeDownloadsView.xaml
index 911e767..b2a9a6d 100644
--- a/VDownload.Core/VDownload.Core.Views/Home/HomeDownloadsView.xaml
+++ b/VDownload.Core/VDownload.Core.Views/Home/HomeDownloadsView.xaml
@@ -98,15 +98,15 @@
Orientation="Horizontal">
-
-
-
diff --git a/VDownload.Core/VDownload.Core.Views/Home/HomePlaylistView.xaml b/VDownload.Core/VDownload.Core.Views/Home/HomePlaylistView.xaml
index ebfbe2f..9b13f73 100644
--- a/VDownload.Core/VDownload.Core.Views/Home/HomePlaylistView.xaml
+++ b/VDownload.Core/VDownload.Core.Views/Home/HomePlaylistView.xaml
@@ -311,13 +311,13 @@
-
+
-
+
-
+
diff --git a/VDownload.Core/VDownload.Core.Views/Home/HomeVideoView.xaml b/VDownload.Core/VDownload.Core.Views/Home/HomeVideoView.xaml
index 73832dc..aff7cb3 100644
--- a/VDownload.Core/VDownload.Core.Views/Home/HomeVideoView.xaml
+++ b/VDownload.Core/VDownload.Core.Views/Home/HomeVideoView.xaml
@@ -111,13 +111,13 @@
-
+
-
+
-
+
diff --git a/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml b/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml
index f1fe579..b9de1bd 100644
--- a/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml
+++ b/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml
@@ -11,6 +11,7 @@
xmlns:ct="using:CommunityToolkit.WinUI"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
+ xmlns:m="using:VDownload.Models"
mc:Ignorable="d"
Background="{ThemeResource ViewBackgroundColor}">
@@ -42,6 +43,81 @@
SpinButtonPlacementMode="Compact"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VDownload/Dictionaries/Images/ImagesLogo.xaml b/VDownload/Dictionaries/Images/ImagesLogo.xaml
index 09e6ce0..1ebe7ea 100644
--- a/VDownload/Dictionaries/Images/ImagesLogo.xaml
+++ b/VDownload/Dictionaries/Images/ImagesLogo.xaml
@@ -3,4 +3,5 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
/Assets/Logo/Logo.png
+ /Assets/Logo/Logo.ico
diff --git a/VDownload/Dictionaries/Images/ImagesSettingsView.xaml b/VDownload/Dictionaries/Images/ImagesSettingsView.xaml
index 51545e0..efa6034 100644
--- a/VDownload/Dictionaries/Images/ImagesSettingsView.xaml
+++ b/VDownload/Dictionaries/Images/ImagesSettingsView.xaml
@@ -5,9 +5,17 @@
/Assets/SettingsView/SearchingPlaylistCountLight.png
+ /Assets/SettingsView/TasksDefaultMediaOptionsLight.png
+ /Assets/SettingsView/TasksRunningTasksLight.png
+ /Assets/SettingsView/TasksFilenameTemplateLight.png
+ /Assets/SettingsView/TasksOutputDirectoryLight.png
/Assets/SettingsView/SearchingPlaylistCountDark.png
+ /Assets/SettingsView/TasksDefaultMediaOptionsDark.png
+ /Assets/SettingsView/TasksRunningTasksDark.png
+ /Assets/SettingsView/TasksFilenameTemplateDark.png
+ /Assets/SettingsView/TasksOutputDirectoryDark.png
diff --git a/VDownload/VDownload.csproj b/VDownload/VDownload.csproj
index ac08e63..e6cb600 100644
--- a/VDownload/VDownload.csproj
+++ b/VDownload/VDownload.csproj
@@ -13,6 +13,7 @@
true
true
false
+ Assets\Logo\Logo.ico
@@ -76,8 +77,6 @@
-
-
@@ -96,6 +95,10 @@
+
+
+
+
@@ -139,6 +142,8 @@
+
+
@@ -190,9 +195,27 @@
+
+ Always
+
+
+ Always
+
Always
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
Always
@@ -411,9 +434,24 @@
Always
+
+ Always
+
Always
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
Always