删除不需要的设置

croire 3 years ago
parent 0a26704f2a
commit e781c72d68

@ -10,13 +10,9 @@ namespace DownKyi.Core.Settings.Models
public VideoCodecs VideoCodecs { get; set; } public VideoCodecs VideoCodecs { get; set; }
public int Quality { get; set; } public int Quality { get; set; }
public int AudioQuality { get; set; } public int AudioQuality { get; set; }
public AllowStatus IsAddOrder { get; set; }
public AllowStatus IsTranscodingFlvToMp4 { get; set; } public AllowStatus IsTranscodingFlvToMp4 { get; set; }
public string SaveVideoRootPath { get; set; } public string SaveVideoRootPath { get; set; }
public List<string> HistoryVideoRootPaths { get; set; } public List<string> HistoryVideoRootPaths { get; set; }
public AllowStatus IsUseSaveVideoRootPath { 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 int audioQuality = 30280;
// 是否在下载的视频前增加序号
private readonly AllowStatus isAddOrder = AllowStatus.NO;
// 是否下载flv视频后转码为mp4 // 是否下载flv视频后转码为mp4
private readonly AllowStatus isTranscodingFlvToMp4 = AllowStatus.YES; private readonly AllowStatus isTranscodingFlvToMp4 = AllowStatus.YES;
@ -30,15 +27,6 @@ namespace DownKyi.Core.Settings
// 是否使用默认下载目录,如果是,则每次点击下载选中项时不再询问下载目录 // 是否使用默认下载目录,如果是,则每次点击下载选中项时不再询问下载目录
private readonly AllowStatus isUseSaveVideoRootPath = AllowStatus.NO; 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>
/// 获取优先下载的视频编码 /// 获取优先下载的视频编码
/// </summary> /// </summary>
@ -120,33 +108,6 @@ namespace DownKyi.Core.Settings
return SetSettings(); 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> /// <summary>
/// 获取是否下载flv视频后转码为mp4 /// 获取是否下载flv视频后转码为mp4
/// </summary> /// </summary>
@ -255,86 +216,5 @@ namespace DownKyi.Core.Settings
return SetSettings(); 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; private List<string> videoCodecs;
public List<string> VideoCodecs public List<string> VideoCodecs
{ {
get { return videoCodecs; } get => videoCodecs;
set { SetProperty(ref videoCodecs, value); } set => SetProperty(ref videoCodecs, value);
} }
private string selectedVideoCodec; private string selectedVideoCodec;
public string SelectedVideoCodec public string SelectedVideoCodec
{ {
get { return selectedVideoCodec; } get => selectedVideoCodec;
set { SetProperty(ref selectedVideoCodec, value); } set => SetProperty(ref selectedVideoCodec, value);
} }
private List<Resolution> videoQualityList; private List<Resolution> videoQualityList;
public List<Resolution> VideoQualityList public List<Resolution> VideoQualityList
{ {
get { return videoQualityList; } get => videoQualityList;
set { SetProperty(ref videoQualityList, value); } set => SetProperty(ref videoQualityList, value);
} }
private Resolution selectedVideoQuality; private Resolution selectedVideoQuality;
public Resolution SelectedVideoQuality public Resolution SelectedVideoQuality
{ {
get { return selectedVideoQuality; } get => selectedVideoQuality;
set { SetProperty(ref selectedVideoQuality, value); } set => SetProperty(ref selectedVideoQuality, value);
} }
private bool isAddVideoOrder; private bool isAddVideoOrder;
public bool IsAddVideoOrder public bool IsAddVideoOrder
{ {
get { return isAddVideoOrder; } get => isAddVideoOrder;
set { SetProperty(ref isAddVideoOrder, value); } set => SetProperty(ref isAddVideoOrder, value);
} }
private bool isTranscodingFlvToMp4; private bool isTranscodingFlvToMp4;
public bool IsTranscodingFlvToMp4 public bool IsTranscodingFlvToMp4
{ {
get { return isTranscodingFlvToMp4; } get => isTranscodingFlvToMp4;
set { SetProperty(ref isTranscodingFlvToMp4, value); } set => SetProperty(ref isTranscodingFlvToMp4, value);
} }
private bool isUseDefaultDirectory; private bool isUseDefaultDirectory;
public bool IsUseDefaultDirectory public bool IsUseDefaultDirectory
{ {
get { return isUseDefaultDirectory; } get => isUseDefaultDirectory;
set { SetProperty(ref isUseDefaultDirectory, value); } set => SetProperty(ref isUseDefaultDirectory, value);
} }
private string saveVideoDirectory; private string saveVideoDirectory;
public string SaveVideoDirectory public string SaveVideoDirectory
{ {
get { return saveVideoDirectory; } get => saveVideoDirectory;
set { SetProperty(ref saveVideoDirectory, value); } set => SetProperty(ref saveVideoDirectory, value);
} }
private bool isCreateFolderForMedia; private bool isCreateFolderForMedia;
public bool IsCreateFolderForMedia public bool IsCreateFolderForMedia
{ {
get { return isCreateFolderForMedia; } get => isCreateFolderForMedia;
set { SetProperty(ref isCreateFolderForMedia, value); } set => SetProperty(ref isCreateFolderForMedia, value);
} }
private bool isDownloadDanmaku; private bool isDownloadDanmaku;
public bool IsDownloadDanmaku public bool IsDownloadDanmaku
{ {
get { return isDownloadDanmaku; } get => isDownloadDanmaku;
set { SetProperty(ref isDownloadDanmaku, value); } set => SetProperty(ref isDownloadDanmaku, value);
} }
private bool isDownloadCover; private bool isDownloadCover;
public bool IsDownloadCover public bool IsDownloadCover
{ {
get { return isDownloadCover; } get => isDownloadCover;
set { SetProperty(ref isDownloadCover, value); } set => SetProperty(ref isDownloadCover, value);
} }
#endregion #endregion
@ -135,9 +135,9 @@ namespace DownKyi.ViewModels.Settings
int quality = SettingsManager.GetInstance().GetQuality(); int quality = SettingsManager.GetInstance().GetQuality();
SelectedVideoQuality = VideoQualityList.FirstOrDefault(t => { return t.Id == quality; }); SelectedVideoQuality = VideoQualityList.FirstOrDefault(t => { return t.Id == quality; });
// 是否在下载的视频前增加序号 //// 是否在下载的视频前增加序号
AllowStatus isAddOrder = SettingsManager.GetInstance().IsAddOrder(); //AllowStatus isAddOrder = SettingsManager.GetInstance().IsAddOrder();
IsAddVideoOrder = isAddOrder == AllowStatus.YES; //IsAddVideoOrder = isAddOrder == AllowStatus.YES;
// 是否下载flv视频后转码为mp4 // 是否下载flv视频后转码为mp4
AllowStatus isTranscodingFlvToMp4 = SettingsManager.GetInstance().IsTranscodingFlvToMp4(); AllowStatus isTranscodingFlvToMp4 = SettingsManager.GetInstance().IsTranscodingFlvToMp4();
@ -150,17 +150,17 @@ namespace DownKyi.ViewModels.Settings
// 默认下载目录 // 默认下载目录
SaveVideoDirectory = SettingsManager.GetInstance().GetSaveVideoRootPath(); SaveVideoDirectory = SettingsManager.GetInstance().GetSaveVideoRootPath();
// 是否为不同视频分别创建文件夹 //// 是否为不同视频分别创建文件夹
AllowStatus isCreateFolderForMedia = SettingsManager.GetInstance().IsCreateFolderForMedia(); //AllowStatus isCreateFolderForMedia = SettingsManager.GetInstance().IsCreateFolderForMedia();
IsCreateFolderForMedia = isCreateFolderForMedia == AllowStatus.YES; //IsCreateFolderForMedia = isCreateFolderForMedia == AllowStatus.YES;
// 是否在下载视频的同时下载弹幕 //// 是否在下载视频的同时下载弹幕
AllowStatus isDownloadDanmaku = SettingsManager.GetInstance().IsDownloadDanmaku(); //AllowStatus isDownloadDanmaku = SettingsManager.GetInstance().IsDownloadDanmaku();
IsDownloadDanmaku = isDownloadDanmaku == AllowStatus.YES; //IsDownloadDanmaku = isDownloadDanmaku == AllowStatus.YES;
// 是否在下载视频的同时下载封面 //// 是否在下载视频的同时下载封面
AllowStatus isDownloadCover = SettingsManager.GetInstance().IsDownloadCover(); //AllowStatus isDownloadCover = SettingsManager.GetInstance().IsDownloadCover();
IsDownloadCover = isDownloadCover == AllowStatus.YES; //IsDownloadCover = isDownloadCover == AllowStatus.YES;
isOnNavigatedTo = false; isOnNavigatedTo = false;
} }
@ -199,20 +199,20 @@ namespace DownKyi.ViewModels.Settings
PublishTip(isSucceed); PublishTip(isSucceed);
} }
// 是否在下载的视频前增加序号事件 //// 是否在下载的视频前增加序号事件
private DelegateCommand IisAddVideoOrderCommand; //private DelegateCommand IisAddVideoOrderCommand;
public DelegateCommand IsAddVideoOrderCommand => IisAddVideoOrderCommand ?? (IisAddVideoOrderCommand = new DelegateCommand(ExecuteIsAddVideoOrderCommand)); //public DelegateCommand IsAddVideoOrderCommand => IisAddVideoOrderCommand ?? (IisAddVideoOrderCommand = new DelegateCommand(ExecuteIsAddVideoOrderCommand));
/// <summary> ///// <summary>
/// 是否在下载的视频前增加序号事件 ///// 是否在下载的视频前增加序号事件
/// </summary> ///// </summary>
private void ExecuteIsAddVideoOrderCommand() //private void ExecuteIsAddVideoOrderCommand()
{ //{
AllowStatus isAddOrder = IsAddVideoOrder ? AllowStatus.YES : AllowStatus.NO; // AllowStatus isAddOrder = IsAddVideoOrder ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsAddOrder(isAddOrder); // bool isSucceed = SettingsManager.GetInstance().IsAddOrder(isAddOrder);
PublishTip(isSucceed); // PublishTip(isSucceed);
} //}
// 是否下载flv视频后转码为mp4事件 // 是否下载flv视频后转码为mp4事件
private DelegateCommand isTranscodingFlvToMp4Command; private DelegateCommand isTranscodingFlvToMp4Command;
@ -265,50 +265,50 @@ namespace DownKyi.ViewModels.Settings
} }
} }
// 是否为不同视频分别创建文件夹事件 //// 是否为不同视频分别创建文件夹事件
private DelegateCommand isCreateFolderForMediaCommand; //private DelegateCommand isCreateFolderForMediaCommand;
public DelegateCommand IsCreateFolderForMediaCommand => isCreateFolderForMediaCommand ?? (isCreateFolderForMediaCommand = new DelegateCommand(ExecuteIsCreateFolderForMediaCommand)); //public DelegateCommand IsCreateFolderForMediaCommand => isCreateFolderForMediaCommand ?? (isCreateFolderForMediaCommand = new DelegateCommand(ExecuteIsCreateFolderForMediaCommand));
/// <summary> ///// <summary>
/// 是否为不同视频分别创建文件夹事件 ///// 是否为不同视频分别创建文件夹事件
/// </summary> ///// </summary>
private void ExecuteIsCreateFolderForMediaCommand() //private void ExecuteIsCreateFolderForMediaCommand()
{ //{
AllowStatus isCreateFolderForMedia = IsCreateFolderForMedia ? AllowStatus.YES : AllowStatus.NO; // AllowStatus isCreateFolderForMedia = IsCreateFolderForMedia ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsCreateFolderForMedia(isCreateFolderForMedia); // bool isSucceed = SettingsManager.GetInstance().IsCreateFolderForMedia(isCreateFolderForMedia);
PublishTip(isSucceed); // PublishTip(isSucceed);
} //}
// 是否在下载视频的同时下载弹幕事件 //// 是否在下载视频的同时下载弹幕事件
private DelegateCommand isDownloadDanmakuCommand; //private DelegateCommand isDownloadDanmakuCommand;
public DelegateCommand IsDownloadDanmakuCommand => isDownloadDanmakuCommand ?? (isDownloadDanmakuCommand = new DelegateCommand(ExecuteIsDownloadDanmakuCommand)); //public DelegateCommand IsDownloadDanmakuCommand => isDownloadDanmakuCommand ?? (isDownloadDanmakuCommand = new DelegateCommand(ExecuteIsDownloadDanmakuCommand));
/// <summary> ///// <summary>
/// 是否在下载视频的同时下载弹幕事件 ///// 是否在下载视频的同时下载弹幕事件
/// </summary> ///// </summary>
private void ExecuteIsDownloadDanmakuCommand() //private void ExecuteIsDownloadDanmakuCommand()
{ //{
AllowStatus isDownloadDanmaku = IsDownloadDanmaku ? AllowStatus.YES : AllowStatus.NO; // AllowStatus isDownloadDanmaku = IsDownloadDanmaku ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsDownloadDanmaku(isDownloadDanmaku); // bool isSucceed = SettingsManager.GetInstance().IsDownloadDanmaku(isDownloadDanmaku);
PublishTip(isSucceed); // PublishTip(isSucceed);
} //}
// 是否在下载视频的同时下载封面事件 //// 是否在下载视频的同时下载封面事件
private DelegateCommand isDownloadCoverCommand; //private DelegateCommand isDownloadCoverCommand;
public DelegateCommand IsDownloadCoverCommand => isDownloadCoverCommand ?? (isDownloadCoverCommand = new DelegateCommand(ExecuteIsDownloadCoverCommand)); //public DelegateCommand IsDownloadCoverCommand => isDownloadCoverCommand ?? (isDownloadCoverCommand = new DelegateCommand(ExecuteIsDownloadCoverCommand));
/// <summary> ///// <summary>
/// 是否在下载视频的同时下载封面事件 ///// 是否在下载视频的同时下载封面事件
/// </summary> ///// </summary>
private void ExecuteIsDownloadCoverCommand() //private void ExecuteIsDownloadCoverCommand()
{ //{
AllowStatus isDownloadCover = IsDownloadCover ? AllowStatus.YES : AllowStatus.NO; // AllowStatus isDownloadCover = IsDownloadCover ? AllowStatus.YES : AllowStatus.NO;
bool isSucceed = SettingsManager.GetInstance().IsDownloadCover(isDownloadCover); // bool isSucceed = SettingsManager.GetInstance().IsDownloadCover(isDownloadCover);
PublishTip(isSucceed); // PublishTip(isSucceed);
} //}
#endregion #endregion

@ -54,31 +54,6 @@
</ComboBox> </ComboBox>
</StackPanel> </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 <CheckBox
Margin="0,20,0,0" Margin="0,20,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
@ -154,44 +129,6 @@
</StackPanel> </StackPanel>
</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> </StackPanel>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>

Loading…
Cancel
Save