mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-24 08:33:36 +00:00
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Lantean.QBitTorrentClient.Models
|
|
{
|
|
public record FileData
|
|
{
|
|
[JsonConstructor]
|
|
public FileData(
|
|
int index,
|
|
string name,
|
|
long size,
|
|
float progress,
|
|
Priority priority,
|
|
bool isSeed,
|
|
IReadOnlyList<int> pieceRange,
|
|
float availability)
|
|
{
|
|
Index = index;
|
|
Name = name;
|
|
Size = size;
|
|
Progress = progress;
|
|
Priority = priority;
|
|
IsSeed = isSeed;
|
|
PieceRange = pieceRange ?? [];
|
|
Availability = availability;
|
|
}
|
|
|
|
[JsonPropertyName("index")]
|
|
public int Index { get; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; }
|
|
|
|
[JsonPropertyName("size")]
|
|
public long Size { get; }
|
|
|
|
[JsonPropertyName("progress")]
|
|
public float Progress { get; }
|
|
|
|
[JsonPropertyName("priority")]
|
|
public Priority Priority { get; }
|
|
|
|
[JsonPropertyName("is_seed")]
|
|
public bool IsSeed { get; }
|
|
|
|
[JsonPropertyName("piece_range")]
|
|
public IReadOnlyList<int> PieceRange { get; }
|
|
|
|
[JsonPropertyName("availability")]
|
|
public float Availability { get; }
|
|
}
|
|
} |