filter controls, default thumbnail, playlist search video removing

This commit is contained in:
2024-03-02 01:05:44 +01:00
Unverified
parent 9465be8d76
commit 17245bb91f
28 changed files with 352 additions and 71 deletions

View File

@@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -71,6 +72,8 @@ namespace VDownload.Core.ViewModels.Home.Helpers
[ObservableProperty]
protected AudioExtension _audioExtension;
public Video Video { get; protected set; }
#endregion
@@ -82,6 +85,8 @@ namespace VDownload.Core.ViewModels.Home.Helpers
_settingsService = settingsService;
_storagePickerService = storagePickerService;
Video = video;
ThumbnailUrl = video.ThumbnailUrl;
Title = video.Title;
Author = video.Author;
@@ -104,6 +109,26 @@ namespace VDownload.Core.ViewModels.Home.Helpers
#region PUBLIC METHODS
public VideoDownloadOptions BuildDownloadOptions()
{
return new VideoDownloadOptions(Duration)
{
MediaType = this.MediaType,
SelectedStream = this.SelectedStream,
TrimStart = this.TrimStart,
TrimEnd = this.TrimEnd,
Directory = this.DirectoryPath,
Filename = string.Join("_", this.Filename.Split(Path.GetInvalidFileNameChars())),
Extension = (this.MediaType == MediaType.OnlyAudio ? this.AudioExtension.ToString() : this.VideoExtension.ToString()).ToLower(),
};
}
#endregion
#region COMMANDS
[RelayCommand]