|
|
|
@ -11,6 +11,7 @@ using DownKyi.Images;
|
|
|
|
|
using DownKyi.Models;
|
|
|
|
|
using DownKyi.Utils;
|
|
|
|
|
using DownKyi.ViewModels.DownloadManager;
|
|
|
|
|
using Prism.Services.Dialogs;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
@ -25,6 +26,8 @@ namespace DownKyi.Services.Download
|
|
|
|
|
{
|
|
|
|
|
protected string Tag = "DownloadService";
|
|
|
|
|
|
|
|
|
|
protected IDialogService dialogService;
|
|
|
|
|
|
|
|
|
|
protected ObservableCollection<DownloadingItem> downloadingList;
|
|
|
|
|
protected ObservableCollection<DownloadedItem> downloadedList;
|
|
|
|
|
|
|
|
|
@ -41,10 +44,13 @@ namespace DownKyi.Services.Download
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="downloading"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DownloadService(ObservableCollection<DownloadingItem> downloadingList, ObservableCollection<DownloadedItem> downloadedList)
|
|
|
|
|
public DownloadService(ObservableCollection<DownloadingItem> downloadingList,
|
|
|
|
|
ObservableCollection<DownloadedItem> downloadedList,
|
|
|
|
|
IDialogService dialogService)
|
|
|
|
|
{
|
|
|
|
|
this.downloadingList = downloadingList;
|
|
|
|
|
this.downloadedList = downloadedList;
|
|
|
|
|
this.dialogService = dialogService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected PlayUrlDashVideo BaseDownloadAudio(DownloadingItem downloading)
|
|
|
|
@ -438,7 +444,20 @@ namespace DownKyi.Services.Download
|
|
|
|
|
// 路径不存在则创建
|
|
|
|
|
if (!Directory.Exists(path))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Core.Utils.Debugging.Console.PrintLine(Tag, e.ToString());
|
|
|
|
|
LogManager.Debug(Tag, e.Message);
|
|
|
|
|
|
|
|
|
|
AlertService alertService = new AlertService(dialogService);
|
|
|
|
|
ButtonResult result = alertService.ShowError($"{path}{DictionaryResource.GetString("DirectoryError")}");
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|