|
|
@ -480,6 +480,13 @@ namespace DownKyi.ViewModels
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LoadingVisibility = Visibility.Collapsed;
|
|
|
|
LoadingVisibility = Visibility.Collapsed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 解析后是否自动下载解析视频
|
|
|
|
|
|
|
|
AllowStatus isAutoDownloadAll = SettingsManager.GetInstance().IsAutoDownloadAll();
|
|
|
|
|
|
|
|
if (parseScope != ParseScope.NONE && isAutoDownloadAll == AllowStatus.YES)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AddToDownload(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -498,56 +505,57 @@ namespace DownKyi.ViewModels
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 添加到下载列表事件
|
|
|
|
/// 添加到下载列表事件
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private async void ExecuteAddToDownloadCommand()
|
|
|
|
private void ExecuteAddToDownloadCommand()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AddToDownloadService addToDownloadService = null;
|
|
|
|
AddToDownload(false);
|
|
|
|
// 视频
|
|
|
|
//AddToDownloadService addToDownloadService = null;
|
|
|
|
if (ParseEntrance.IsAvUrl(input) || ParseEntrance.IsBvUrl(input))
|
|
|
|
//// 视频
|
|
|
|
{
|
|
|
|
//if (ParseEntrance.IsAvUrl(input) || ParseEntrance.IsBvUrl(input))
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.VIDEO);
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// addToDownloadService = new AddToDownloadService(PlayStreamType.VIDEO);
|
|
|
|
// 番剧(电影、电视剧)
|
|
|
|
//}
|
|
|
|
else if (ParseEntrance.IsBangumiSeasonUrl(input) || ParseEntrance.IsBangumiEpisodeUrl(input) || ParseEntrance.IsBangumiMediaUrl(input))
|
|
|
|
//// 番剧(电影、电视剧)
|
|
|
|
{
|
|
|
|
//else if (ParseEntrance.IsBangumiSeasonUrl(input) || ParseEntrance.IsBangumiEpisodeUrl(input) || ParseEntrance.IsBangumiMediaUrl(input))
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.BANGUMI);
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// addToDownloadService = new AddToDownloadService(PlayStreamType.BANGUMI);
|
|
|
|
// 课程
|
|
|
|
//}
|
|
|
|
else if (ParseEntrance.IsCheeseSeasonUrl(input) || ParseEntrance.IsCheeseEpisodeUrl(input))
|
|
|
|
//// 课程
|
|
|
|
{
|
|
|
|
//else if (ParseEntrance.IsCheeseSeasonUrl(input) || ParseEntrance.IsCheeseEpisodeUrl(input))
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.CHEESE);
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// addToDownloadService = new AddToDownloadService(PlayStreamType.CHEESE);
|
|
|
|
else
|
|
|
|
//}
|
|
|
|
{
|
|
|
|
//else
|
|
|
|
return;
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// return;
|
|
|
|
|
|
|
|
//}
|
|
|
|
// 选择文件夹
|
|
|
|
|
|
|
|
string directory = addToDownloadService.SetDirectory(dialogService);
|
|
|
|
//// 选择文件夹
|
|
|
|
|
|
|
|
//string directory = addToDownloadService.SetDirectory(dialogService);
|
|
|
|
// 视频计数
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
//// 视频计数
|
|
|
|
await Task.Run(() =>
|
|
|
|
//int i = 0;
|
|
|
|
{
|
|
|
|
//await Task.Run(() =>
|
|
|
|
// 传递video对象
|
|
|
|
//{
|
|
|
|
addToDownloadService.GetVideo(VideoInfoView, VideoSections.ToList());
|
|
|
|
// // 传递video对象
|
|
|
|
// 下载
|
|
|
|
// addToDownloadService.GetVideo(VideoInfoView, VideoSections.ToList());
|
|
|
|
i = addToDownloadService.AddToDownload(eventAggregator, directory);
|
|
|
|
// // 下载
|
|
|
|
});
|
|
|
|
// i = addToDownloadService.AddToDownload(eventAggregator, directory);
|
|
|
|
|
|
|
|
//});
|
|
|
|
if (directory == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
//if (directory == null)
|
|
|
|
return;
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// return;
|
|
|
|
|
|
|
|
//}
|
|
|
|
// 通知用户添加到下载列表的结果
|
|
|
|
|
|
|
|
if (i <= 0)
|
|
|
|
//// 通知用户添加到下载列表的结果
|
|
|
|
{
|
|
|
|
//if (i <= 0)
|
|
|
|
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
|
|
|
|
else
|
|
|
|
//}
|
|
|
|
{
|
|
|
|
//else
|
|
|
|
eventAggregator.GetEvent<MessageEvent>().Publish($"{DictionaryResource.GetString("TipAddDownloadingFinished1")}{i}{DictionaryResource.GetString("TipAddDownloadingFinished2")}");
|
|
|
|
//{
|
|
|
|
}
|
|
|
|
// eventAggregator.GetEvent<MessageEvent>().Publish($"{DictionaryResource.GetString("TipAddDownloadingFinished1")}{i}{DictionaryResource.GetString("TipAddDownloadingFinished2")}");
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -663,6 +671,62 @@ namespace DownKyi.ViewModels
|
|
|
|
videoInfoService.GetVideoStream(videoPage);
|
|
|
|
videoInfoService.GetVideoStream(videoPage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 添加到下载列表事件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
private async void AddToDownload(bool isAll)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AddToDownloadService addToDownloadService = null;
|
|
|
|
|
|
|
|
// 视频
|
|
|
|
|
|
|
|
if (ParseEntrance.IsAvUrl(input) || ParseEntrance.IsBvUrl(input))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.VIDEO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 番剧(电影、电视剧)
|
|
|
|
|
|
|
|
else if (ParseEntrance.IsBangumiSeasonUrl(input) || ParseEntrance.IsBangumiEpisodeUrl(input) || ParseEntrance.IsBangumiMediaUrl(input))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.BANGUMI);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 课程
|
|
|
|
|
|
|
|
else if (ParseEntrance.IsCheeseSeasonUrl(input) || ParseEntrance.IsCheeseEpisodeUrl(input))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addToDownloadService = new AddToDownloadService(PlayStreamType.CHEESE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 选择文件夹
|
|
|
|
|
|
|
|
string directory = addToDownloadService.SetDirectory(dialogService);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 视频计数
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
await Task.Run(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 传递video对象
|
|
|
|
|
|
|
|
addToDownloadService.GetVideo(VideoInfoView, VideoSections.ToList());
|
|
|
|
|
|
|
|
// 下载
|
|
|
|
|
|
|
|
i = addToDownloadService.AddToDownload(eventAggregator, directory, isAll);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (directory == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通知用户添加到下载列表的结果
|
|
|
|
|
|
|
|
if (i <= 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
eventAggregator.GetEvent<MessageEvent>().Publish($"{DictionaryResource.GetString("TipAddDownloadingFinished1")}{i}{DictionaryResource.GetString("TipAddDownloadingFinished2")}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|