解决一些问题

croire 3 years ago
parent 1b0bacbd33
commit a023935c7c

@ -7,6 +7,6 @@
public VideoSettings Video { get; set; } = new VideoSettings();
public DanmakuSettings Danmaku { get; set; } = new DanmakuSettings();
public AboutSettings About { get; set; } = new AboutSettings();
public UserInfoSettings UserInfo { get; set; }
public UserInfoSettings UserInfo { get; set; } = new UserInfoSettings();
}
}

@ -207,6 +207,8 @@ namespace DownKyi.Services.Download
// 添加到下载
foreach (VideoSection section in videoSections)
{
if (section.VideoPages == null) { continue; }
foreach (VideoPage page in section.VideoPages)
{
// 只下载选中项,跳过未选中项
@ -338,49 +340,49 @@ namespace DownKyi.Services.Download
break;
}
// 如果不存在,直接添加到下载列表
DownloadBase downloadBase = new DownloadBase
{
Bvid = page.Bvid,
Avid = page.Avid,
Cid = page.Cid,
EpisodeId = page.EpisodeId,
CoverUrl = videoInfoView.CoverUrl,
PageCoverUrl = page.FirstFrame,
ZoneId = zoneId,
FilePath = filePath,
Order = page.Order,
MainTitle = videoInfoView.Title,
Name = page.Name,
Duration = page.Duration,
VideoCodecName = page.VideoQuality.SelectedVideoCodec,
Resolution = new Quality { Name = page.VideoQuality.QualityFormat, Id = page.VideoQuality.Quality },
AudioCodec = Constant.GetAudioQualities().FirstOrDefault(t => { return t.Name == page.AudioQualityFormat; }),
};
Downloading downloading = new Downloading
{
PlayStreamType = playStreamType,
DownloadStatus = DownloadStatus.NOT_STARTED,
};
// 需要下载的内容
downloadBase.NeedDownloadContent["downloadAudio"] = downloadAudio;
downloadBase.NeedDownloadContent["downloadVideo"] = downloadVideo;
downloadBase.NeedDownloadContent["downloadDanmaku"] = downloadDanmaku;
downloadBase.NeedDownloadContent["downloadSubtitle"] = downloadSubtitle;
downloadBase.NeedDownloadContent["downloadCover"] = downloadCover;
DownloadingItem downloadingItem = new DownloadingItem
{
DownloadBase = downloadBase,
Downloading = downloading,
PlayUrl = page.PlayUrl,
};
// 添加到下载列表
App.PropertyChangeAsync(new Action(() =>
{
// 如果不存在,直接添加到下载列表
DownloadBase downloadBase = new DownloadBase
{
Bvid = page.Bvid,
Avid = page.Avid,
Cid = page.Cid,
EpisodeId = page.EpisodeId,
CoverUrl = videoInfoView.CoverUrl,
PageCoverUrl = page.FirstFrame,
ZoneId = zoneId,
FilePath = filePath,
Order = page.Order,
MainTitle = videoInfoView.Title,
Name = page.Name,
Duration = page.Duration,
VideoCodecName = page.VideoQuality.SelectedVideoCodec,
Resolution = new Quality { Name = page.VideoQuality.QualityFormat, Id = page.VideoQuality.Quality },
AudioCodec = Constant.GetAudioQualities().FirstOrDefault(t => { return t.Name == page.AudioQualityFormat; }),
};
Downloading downloading = new Downloading
{
PlayStreamType = playStreamType,
DownloadStatus = DownloadStatus.NOT_STARTED,
};
// 需要下载的内容
downloadBase.NeedDownloadContent["downloadAudio"] = downloadAudio;
downloadBase.NeedDownloadContent["downloadVideo"] = downloadVideo;
downloadBase.NeedDownloadContent["downloadDanmaku"] = downloadDanmaku;
downloadBase.NeedDownloadContent["downloadSubtitle"] = downloadSubtitle;
downloadBase.NeedDownloadContent["downloadCover"] = downloadCover;
DownloadingItem downloadingItem = new DownloadingItem
{
DownloadBase = downloadBase,
Downloading = downloading,
PlayUrl = page.PlayUrl,
};
App.DownloadingList.Add(downloadingItem);
Thread.Sleep(10);
}));

@ -276,7 +276,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -329,7 +329,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -358,7 +358,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -272,7 +272,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -258,7 +258,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -279,7 +279,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

@ -313,7 +313,7 @@ namespace DownKyi.ViewModels
}
// 通知用户添加到下载列表的结果
if (i == 0)
if (i <= 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}

Loading…
Cancel
Save