mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-28 02:23:52 +00:00
Add project files.
This commit is contained in:
52
Lantean.QBitTorrentClient/Models/FileData.cs
Normal file
52
Lantean.QBitTorrentClient/Models/FileData.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user