Add download worker and download service

This commit is contained in:
Misaki
2024-06-05 19:24:57 +09:00
parent 307701c6c5
commit 150cd3cb26
8 changed files with 278 additions and 65 deletions

View File

@@ -1,33 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Downloader;
namespace DownloadManager.Models;
public class DownloadItemData
{
public required string FileName
public DownloadItemData(string fileName, string filePath, string url, DownloadConfiguration downloadConfig)
{
Id = Guid.NewGuid();
FileName = fileName;
FilePath = filePath;
Url = url;
downloadConfiguration = downloadConfig;
}
public Guid Id
{
get;
}
public string FileName
{
get;
}
public string FilePath
{
get;
}
public string Url
{
get;
}
public DownloadConfiguration downloadConfiguration
{
get;
}
public long FileSize
{
get; set;
}
public required string Url
public double Speed
{
get; set;
}
public required long FileSize
public int Progress
{
get; set;
}
public required long Speed
{
get; set;
}
public required int Progress
{
get; set;
}
public required DownloadStatus Status
public DownloadStatus Status
{
get; set;
}

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DownloadManager.Models;
public enum DownloadStatus
{
Downloading,
Pausing,
Done,
Cancel
}