删除不需要的设置

croire 3 years ago
parent 0a26704f2a
commit e781c72d68

@ -10,13 +10,9 @@ namespace DownKyi.Core.Settings.Models
public VideoCodecs VideoCodecs { get; set; }
public int Quality { get; set; }
public int AudioQuality { get; set; }
public AllowStatus IsAddOrder { get; set; }
public AllowStatus IsTranscodingFlvToMp4 { get; set; }
public string SaveVideoRootPath { get; set; }
public List<string> HistoryVideoRootPaths { get; set; }
public AllowStatus IsUseSaveVideoRootPath { get; set; }
public AllowStatus IsCreateFolderForMedia { get; set; }
public AllowStatus IsDownloadDanmaku { get; set; }
public AllowStatus IsDownloadCover { get; set; }
}
}

@ -15,9 +15,6 @@ namespace DownKyi.Core.Settings
// 设置优先下载音质
private readonly int audioQuality = 30280;
// 是否在下载的视频前增加序号
private readonly AllowStatus isAddOrder = AllowStatus.NO;
// 是否下载flv视频后转码为mp4
private readonly AllowStatus isTranscodingFlvToMp4 = AllowStatus.YES;
@ -30,15 +27,6 @@ namespace DownKyi.Core.Settings
// 是否使用默认下载目录,如果是,则每次点击下载选中项时不再询问下载目录
private readonly AllowStatus isUseSaveVideoRootPath = AllowStatus.NO;
// 是否为不同视频分别创建文件夹
private readonly AllowStatus isCreateFolderForMedia = AllowStatus.YES;
// 是否在下载视频的同时下载弹幕
private readonly AllowStatus isDownloadDanmaku = AllowStatus.YES;
// 是否在下载视频的同时下载封面
private readonly AllowStatus isDownloadCover = AllowStatus.YES;
/// <summary>
/// 获取优先下载的视频编码
/// </summary>
@ -120,33 +108,6 @@ namespace DownKyi.Core.Settings
return SetSettings();
}
/// <summary>
/// 获取是否给视频增加序号
/// </summary>
/// <returns></returns>
public AllowStatus IsAddOrder()
{
appSettings = GetSettings();
if (appSettings.Video.IsAddOrder == 0)
{
// 第一次获取,先设置默认值
IsAddOrder(isAddOrder);
return isAddOrder;
}
return appSettings.Video.IsAddOrder;
}
/// <summary>
/// 设置是否给视频增加序号
/// </summary>
/// <param name="isAddOrder"></param>
/// <returns></returns>
public bool IsAddOrder(AllowStatus isAddOrder)
{
appSettings.Video.IsAddOrder = isAddOrder;
return SetSettings();
}
/// <summary>
/// 获取是否下载flv视频后转码为mp4
/// </summary>
@ -255,86 +216,5 @@ namespace DownKyi.Core.Settings
return SetSettings();
}
/// <summary>
/// 获取是否为不同视频分别创建文件夹
/// </summary>
/// <returns></returns>
public AllowStatus IsCreateFolderForMedia()
{
appSettings = GetSettings();
if (appSettings.Video.IsCreateFolderForMedia == 0)
{
// 第一次获取,先设置默认值
IsCreateFolderForMedia(isCreateFolderForMedia);
return isCreateFolderForMedia;
}
return appSettings.Video.IsCreateFolderForMedia;
}
/// <summary>
/// 设置是否为不同视频分别创建文件夹
/// </summary>
/// <param name="isCreateFolderForMedia"></param>
/// <returns></returns>
public bool IsCreateFolderForMedia(AllowStatus isCreateFolderForMedia)
{
appSettings.Video.IsCreateFolderForMedia = isCreateFolderForMedia;
return SetSettings();
}
/// <summary>
/// 获取是否在下载视频的同时下载弹幕
/// </summary>
/// <returns></returns>
public AllowStatus IsDownloadDanmaku()
{
appSettings = GetSettings();
if (appSettings.Video.IsDownloadDanmaku == 0)
{
// 第一次获取,先设置默认值
IsDownloadDanmaku(isDownloadDanmaku);
return isDownloadDanmaku;
}
return appSettings.Video.IsDownloadDanmaku;
}
/// <summary>
/// 设置是否在下载视频的同时下载弹幕
/// </summary>
/// <param name="isDownloadDanmaku"></param>
/// <returns></returns>
public bool IsDownloadDanmaku(AllowStatus isDownloadDanmaku)
{
appSettings.Video.IsDownloadDanmaku = isDownloadDanmaku;
return SetSettings();
}
/// <summary>
/// 获取是否在下载视频的同时下载封面
/// </summary>
/// <returns></returns>
public AllowStatus IsDownloadCover()
{
appSettings = GetSettings();
if (appSettings.Video.IsDownloadCover == 0)
{
// 第一次获取,先设置默认值
IsDownloadCover(isDownloadCover);
return isDownloadCover;
}
return appSettings.Video.IsDownloadCover;
}
/// <summary>
/// 设置是否在下载视频的同时下载封面
/// </summary>
/// <param name="isDownloadCover"></param>
/// <returns></returns>
public bool IsDownloadCover(AllowStatus isDownloadCover)
{
appSettings.Video.IsDownloadCover = isDownloadCover;
return SetSettings();
}
}
}

@ -22,78 +22,78 @@ namespace DownKyi.ViewModels.Settings
private List<string> videoCodecs;
public List<string> VideoCodecs
{
get { return videoCodecs; }
set { SetProperty(ref videoCodecs, value); }
get => videoCodecs;
set => SetProperty(ref videoCodecs, value);
}
private string selectedVideoCodec;
public string SelectedVideoCodec
{
get { return selectedVideoCodec; }
set { SetProperty(ref selectedVideoCodec, value); }
get => selectedVideoCodec;
set => SetProperty(ref selectedVideoCodec, value);
}
private List<Resolution> videoQualityList;
public List<Resolution> VideoQualityList
{
get { return videoQualityList; }
set { SetProperty(ref videoQualityList, value); }
get => videoQualityList;
set => SetProperty(ref videoQualityList, value);
}
private Resolution selectedVideoQuality;
public Resolution SelectedVideoQuality
{
get { return selectedVideoQuality; }
set { SetProperty(ref selectedVideoQuality, value); }
get => selectedVideoQuality;
set => SetProperty(ref selectedVideoQuality, value);
}
private bool isAddVideoOrder;
public bool IsAddVideoOrder
{
get { return isAddVideoOrder; }
set { SetProperty(ref isAddVideoOrder, value); }
get => isAddVideoOrder;
set => SetProperty(ref isAddVideoOrder, value);
}
private bool isTranscodingFlvToMp4;
public bool IsTranscodingFlvToMp4
{
get { return isTranscodingFlvToMp4; }
set { SetProperty(ref isTranscodingFlvToMp4, value); }
get => isTranscodingFlvToMp4;
set => SetProperty(ref isTranscodingFlvToMp4, value);
}
private bool isUseDefaultDirectory;
public bool IsUseDefaultDirectory
{
get { return isUseDefaultDirectory; }
set { SetProperty(ref isUseDefaultDirectory, value); }
get => isUseDefaultDirectory;
set => SetProperty(ref isUseDefaultDirectory, value);
}
private string saveVideoDirectory;
public string SaveVideoDirectory
{
get { return saveVideoDirectory; }
set { SetProperty(ref saveVideoDirectory, value); }
get => saveVideoDirectory;
set => SetProperty(ref saveVideoDirectory, value);
}
private bool isCreateFolderForMedia;
public bool IsCreateFolderForMedia
{
get { return isCreateFolderForMedia; }
set { SetProperty(ref isCreateFolderForMedia, value); }
get => isCreateFolderForMedia;
set => SetProperty(ref isCreateFolderForMedia, value);
}
private bool isDownloadDanmaku;
public bool IsDownloadDanmaku
{
get { return isDownloadDanmaku; }
set { SetProperty(ref isDownloadDanmaku, value); }
get => isDownloadDanmaku;
set => SetProperty(ref isDownloadDanmaku, value);
}
private bool isDownloadCover;
public bool IsDownloadCover
{
get { return isDownloadCover; }
set { SetProperty(ref isDownloadCover, value); }
get => isDownloadCover;
set => SetProperty(ref isDownloadCover, value);
}
#endregion
@ -135,9 +135,9 @@ namespace DownKyi.ViewModels.Settings
int quality = SettingsManager.GetInstance().GetQuality();
SelectedVideoQuality = VideoQualityList.FirstOrDefault(t => { return t.Id == quality; });
// 是否在下载的视频前增加序号
AllowStatus isAddOrder = SettingsManager.GetInstance().IsAddOrder();
IsAddVideoOrder = isAddOrder == AllowStatus.YES;
//// 是否在下载的视频前增加序号
//AllowStatus isAddOrder = SettingsManager.GetInstance().IsAddOrder();
//IsAddVideoOrder = isAddOrder == AllowStatus.YES;
// 是否下载flv视频后转码为mp4
AllowStatus isTranscodingFlvToMp4 = SettingsManager.GetInstance().IsTranscodingFlvToMp4();
@ -150,17 +150,17 @@ namespace DownKyi.ViewModels.Settings
// 默认下载目录
SaveVideoDirectory = SettingsManager.GetInstance().GetSaveVideoRootPath();
// 是否为不同视频分别创建文件夹
AllowStatus isCreateFolderForMedia = SettingsManager.GetInstance().IsCreateFolderForMedia();
IsCreateFolderForMedia = isCreateFolderForMedia == AllowStatus.YES;
//// 是否为不同视频分别创建文件夹
//AllowStatus isCreateFolderForMedia = SettingsManager.GetInstance().IsCreateFolderForMedia();
//IsCreateFolderForMedia = isCreateFolderForMedia == AllowStatus.YES;
// 是否在下载视频的同时下载弹幕
AllowStatus isDownloadDanmaku = SettingsManager.GetInstance().IsDownloadDanmaku();
IsDownloadDanmaku = isDownloadDanmaku == AllowStatus.YES;
//// 是否在下载视频的同时下载弹幕
//AllowStatus isDownloadDanmaku = SettingsManager.GetInstance().IsDownloadDanmaku();
//IsDownloadDanmaku = isDownloadDanmaku == AllowStatus.YES;
// 是否在下载视频的同时下载封面
AllowStatus isDownloadCover = SettingsManager.GetInstance().IsDownloadCover();
IsDownloadCover = isDownloadCover == AllowStatus.YES;
//// 是否在下载视频的同时下载封面
//AllowStatus isDownloadCover = SettingsManager.GetInstance().IsDownloadCover();
//IsDownloadCover = isDownloadCover == AllowStatus.YES;
isOnNavigatedTo = false;
}
@ -199,20 +199,20 @@ namespace DownKyi.ViewModels.Settings
PublishTip(isSucceed);
}
// 是否在下载的视频前增加序号事件
private DelegateCommand IisAddVideoOrderCommand;
public DelegateCommand IsAddVideoOrderCommand => IisAddVideoOrderCommand ?? (IisAddVideoOrderCommand = new DelegateCommand(ExecuteIsAddVideoOrderCommand));
//// 是否在下载的视频前增加序号事件
//private DelegateCommand IisAddVideoOrderCommand;
//public DelegateCommand IsAddVideoOrderCommand => IisAddVideoOrderCommand ?? (IisAddVideoOrderCommand = new DelegateCommand(ExecuteIsAddVideoOrderCommand));
/// <summary>
/// 是否在下载的视频前增加序号事件
/// </summary>
private void ExecuteIsAddVideoOrderCommand()
{
AllowStatus isAddOrder = IsAddVideoOrder ? AllowStatus.YES : AllowStatus.NO;
///// <summary>
///// 是否在下载的视频前增加序号事件
///// </summary>
//private void ExecuteIsAddVideoOrderCommand()
//{
// AllowStatus isAddOrder = IsAddVideoOrder ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsAddOrder(isAddOrder);
PublishTip(isSucceed);
}
// bool isSucceed = SettingsManager.GetInstance().IsAddOrder(isAddOrder);
// PublishTip(isSucceed);
//}
// 是否下载flv视频后转码为mp4事件
private DelegateCommand isTranscodingFlvToMp4Command;
@ -265,50 +265,50 @@ namespace DownKyi.ViewModels.Settings
}
}
// 是否为不同视频分别创建文件夹事件
private DelegateCommand isCreateFolderForMediaCommand;
public DelegateCommand IsCreateFolderForMediaCommand => isCreateFolderForMediaCommand ?? (isCreateFolderForMediaCommand = new DelegateCommand(ExecuteIsCreateFolderForMediaCommand));
/// <summary>
/// 是否为不同视频分别创建文件夹事件
/// </summary>
private void ExecuteIsCreateFolderForMediaCommand()
{
AllowStatus isCreateFolderForMedia = IsCreateFolderForMedia ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsCreateFolderForMedia(isCreateFolderForMedia);
PublishTip(isSucceed);
}
// 是否在下载视频的同时下载弹幕事件
private DelegateCommand isDownloadDanmakuCommand;
public DelegateCommand IsDownloadDanmakuCommand => isDownloadDanmakuCommand ?? (isDownloadDanmakuCommand = new DelegateCommand(ExecuteIsDownloadDanmakuCommand));
/// <summary>
/// 是否在下载视频的同时下载弹幕事件
/// </summary>
private void ExecuteIsDownloadDanmakuCommand()
{
AllowStatus isDownloadDanmaku = IsDownloadDanmaku ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsDownloadDanmaku(isDownloadDanmaku);
PublishTip(isSucceed);
}
// 是否在下载视频的同时下载封面事件
private DelegateCommand isDownloadCoverCommand;
public DelegateCommand IsDownloadCoverCommand => isDownloadCoverCommand ?? (isDownloadCoverCommand = new DelegateCommand(ExecuteIsDownloadCoverCommand));
/// <summary>
/// 是否在下载视频的同时下载封面事件
/// </summary>
private void ExecuteIsDownloadCoverCommand()
{
AllowStatus isDownloadCover = IsDownloadCover ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsDownloadCover(isDownloadCover);
PublishTip(isSucceed);
}
//// 是否为不同视频分别创建文件夹事件
//private DelegateCommand isCreateFolderForMediaCommand;
//public DelegateCommand IsCreateFolderForMediaCommand => isCreateFolderForMediaCommand ?? (isCreateFolderForMediaCommand = new DelegateCommand(ExecuteIsCreateFolderForMediaCommand));
///// <summary>
///// 是否为不同视频分别创建文件夹事件
///// </summary>
//private void ExecuteIsCreateFolderForMediaCommand()
//{
// AllowStatus isCreateFolderForMedia = IsCreateFolderForMedia ? AllowStatus.YES : AllowStatus.NO;
// bool isSucceed = SettingsManager.GetInstance().IsCreateFolderForMedia(isCreateFolderForMedia);
// PublishTip(isSucceed);
//}
//// 是否在下载视频的同时下载弹幕事件
//private DelegateCommand isDownloadDanmakuCommand;
//public DelegateCommand IsDownloadDanmakuCommand => isDownloadDanmakuCommand ?? (isDownloadDanmakuCommand = new DelegateCommand(ExecuteIsDownloadDanmakuCommand));
///// <summary>
///// 是否在下载视频的同时下载弹幕事件
///// </summary>
//private void ExecuteIsDownloadDanmakuCommand()
//{
// AllowStatus isDownloadDanmaku = IsDownloadDanmaku ? AllowStatus.YES : AllowStatus.NO;
// bool isSucceed = SettingsManager.GetInstance().IsDownloadDanmaku(isDownloadDanmaku);
// PublishTip(isSucceed);
//}
//// 是否在下载视频的同时下载封面事件
//private DelegateCommand isDownloadCoverCommand;
//public DelegateCommand IsDownloadCoverCommand => isDownloadCoverCommand ?? (isDownloadCoverCommand = new DelegateCommand(ExecuteIsDownloadCoverCommand));
///// <summary>
///// 是否在下载视频的同时下载封面事件
///// </summary>
//private void ExecuteIsDownloadCoverCommand()
//{
// AllowStatus isDownloadCover = IsDownloadCover ? AllowStatus.YES : AllowStatus.NO;
// bool isSucceed = SettingsManager.GetInstance().IsDownloadCover(isDownloadCover);
// PublishTip(isSucceed);
//}
#endregion

@ -54,31 +54,6 @@
</ComboBox>
</StackPanel>
<TextBlock
Height="1"
Margin="0,20,0,0"
Background="{DynamicResource BrushBorder}" />
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<CheckBox
Name="nameIsAddVideoOrder"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding IsAddVideoOrderCommand}"
Content="{DynamicResource IsAddVideoOrder}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsAddVideoOrder, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{DynamicResource IsAddVideoOrderTip}" />
</StackPanel>
<CheckBox
Margin="0,20,0,0"
HorizontalAlignment="Left"
@ -154,44 +129,6 @@
</StackPanel>
</StackPanel>
<CheckBox
Margin="0,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding IsCreateFolderForMediaCommand}"
Content="{DynamicResource IsCreateFolderForMedia}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsCreateFolderForMedia, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<TextBlock
Height="1"
Margin="0,20,0,0"
Background="{DynamicResource BrushBorder}" />
<CheckBox
Margin="0,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding IsDownloadDanmakuCommand}"
Content="{DynamicResource IsDownloadDanmaku}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsDownloadDanmaku, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<CheckBox
Margin="0,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding IsDownloadCoverCommand}"
Content="{DynamicResource IsDownloadCover}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsDownloadCover, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
</StackPanel>
</ScrollViewer>
</UserControl>

Loading…
Cancel
Save