修复下载内容设置偶尔不生效的问题

croire 3 years ago
parent 8a2274fc08
commit ec8b03166f

@ -4,6 +4,7 @@ using DownKyi.Core.BiliApi.Zone;
using DownKyi.Core.FileName; using DownKyi.Core.FileName;
using DownKyi.Core.Logging; using DownKyi.Core.Logging;
using DownKyi.Core.Settings; using DownKyi.Core.Settings;
using DownKyi.Core.Settings.Models;
using DownKyi.Core.Utils; using DownKyi.Core.Utils;
using DownKyi.Events; using DownKyi.Events;
using DownKyi.Models; using DownKyi.Models;
@ -160,6 +161,14 @@ namespace DownKyi.Services.Download
// 是否使用默认下载目录 // 是否使用默认下载目录
if (SettingsManager.GetInstance().IsUseSaveVideoRootPath() == AllowStatus.YES) if (SettingsManager.GetInstance().IsUseSaveVideoRootPath() == AllowStatus.YES)
{ {
// 下载内容
VideoContentSettings videoContent = SettingsManager.GetInstance().GetVideoContent();
downloadAudio = videoContent.DownloadAudio;
downloadVideo = videoContent.DownloadVideo;
downloadDanmaku = videoContent.DownloadDanmaku;
downloadSubtitle = videoContent.DownloadSubtitle;
downloadCover = videoContent.DownloadCover;
directory = SettingsManager.GetInstance().GetSaveVideoRootPath(); directory = SettingsManager.GetInstance().GetSaveVideoRootPath();
} }
else else
@ -196,6 +205,13 @@ namespace DownKyi.Services.Download
return directory; return directory;
} }
/// <summary>
/// 添加到下载列表
/// </summary>
/// <param name="eventAggregator">传递事件的对象</param>
/// <param name="directory">下载路径</param>
/// <param name="isAll">是否下载所有,包括未选中项</param>
/// <returns>添加的数量</returns>
public int AddToDownload(IEventAggregator eventAggregator, string directory, bool isAll = false) public int AddToDownload(IEventAggregator eventAggregator, string directory, bool isAll = false)
{ {
if (directory == null || directory == string.Empty) { return -1; } if (directory == null || directory == string.Empty) { return -1; }

@ -671,10 +671,10 @@ namespace DownKyi.ViewModels
videoInfoService.GetVideoStream(videoPage); videoInfoService.GetVideoStream(videoPage);
} }
/// <summary> /// <summary>
/// 添加到下载列表事件 /// 添加到下载列表事件
/// </summary> /// </summary>
/// <param name="isAll">是否下载所有,包括未选中项</param>
private async void AddToDownload(bool isAll) private async void AddToDownload(bool isAll)
{ {
AddToDownloadService addToDownloadService = null; AddToDownloadService addToDownloadService = null;

Loading…
Cancel
Save