mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-25 07:48:01 +03:00
23 lines
695 B
C#
23 lines
695 B
C#
namespace ServiceLib.Models.Dto;
|
|
|
|
public record FileDownloadState
|
|
{
|
|
public required FileDownloadRequest Request { get; init; }
|
|
public long DownloadedBytes { get; init; } = 0;
|
|
public long TotalBytes { get; init; } = 0;
|
|
public double SpeedBytesPerSecond { get; init; } = 0;
|
|
public bool Completed { get; init; } = false;
|
|
|
|
public Exception? Error { get; init; }
|
|
public bool IsFailed => Error != null;
|
|
}
|
|
|
|
public record FileDownloadRequest
|
|
{
|
|
public required string FileUrl { get; init; }
|
|
public required string FilePath { get; init; }
|
|
public string? DisplayFileName { get; init; }
|
|
|
|
public string FileName => DisplayFileName ?? Path.GetFileName(FilePath);
|
|
}
|