diff options
author | Christian Segundo | 2023-06-17 11:17:31 +0200 |
---|---|---|
committer | Christian Segundo | 2023-06-17 11:17:31 +0200 |
commit | b02b7f71978a172848322f0671d580e425634916 (patch) | |
tree | 057fba90b084b82a200ca76b424a9dd9fa204d2f /src/types.zig | |
parent | c7412022c3c607c809f774db2459f9259ba95038 (diff) | |
download | zmission-b02b7f71978a172848322f0671d580e425634916.tar.gz |
one step closer
Diffstat (limited to 'src/types.zig')
-rw-r--r-- | src/types.zig | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/src/types.zig b/src/types.zig index b8029ca..7de8fa1 100644 --- a/src/types.zig +++ b/src/types.zig @@ -11,9 +11,14 @@ pub const Torrent = struct { // When the torrent was first added. addedDate: ?i64 = null, - //availability: []struct {}, array (see below) tr_torrepieceCountntAvailability() + // An array of numbers representing the number of connected peers that + // have each piece, or -1 if we already have the piece ourselves. + availability: ?[]i64 = null, - //bandwidthPriority: ?usize = null, + // ?? + bandwidthPriority: ?i8 = null, + + // ?? comment: ?[]u8 = null, // Byte count of all the corrupt data you've ever downloaded for @@ -21,8 +26,11 @@ pub const Torrent = struct { // grow very large. corruptEver: ?u64 = null, + // ?? creator: ?[]u8 = null, - //dateCreated: ?usize = null, + + // ?? + dateCreated: ?i64 = null, // Byte count of all the piece data we want and don't have yet, // but that a connected peer does have. @@ -31,6 +39,7 @@ pub const Torrent = struct { // When the torrent finished downloading. doneDate: ?i64 = null, + // ?? downloadDir: ?[]u8 = null, // Byte count of all the non-corrupt data you've ever downloaded @@ -38,7 +47,9 @@ pub const Torrent = struct { // time, this will be `2*totalSize`. downloadedEver: ?u64 = null, + // TODO: ?? can't find the definition anywhere //downloadLimit: ?usize = null, + downloadLimited: ?bool = null, // The last time during this session that a rarely-changing field @@ -47,7 +58,22 @@ pub const Torrent = struct { // to reload fields that rarely change. editDate: ?i64 = null, - //@"error": ?usize = null, + // Defines what kind of text is in errorString. + @"error": ?enum { + // everything's fine + ok, + + // when we announced to the tracker, we got a warning in the response + tracker_warning, + + // when we announced to the tracker, we got an error in the response + tracker_error, + + // local trouble, such as disk full or permissions error + local_error, + }, + + // A warning or error message regarding the torrent. errorString: ?[]u8 = null, // If downloading, estimated number of seconds left until the torrent is done. @@ -57,9 +83,21 @@ pub const Torrent = struct { // If seeding, number of seconds left until the idle time limit is reached. etaIdle: ?i64 = null, - //@"file-count": ?usize = null, - ////files array (see below) n/a - ////fileStats array (see below) n/a + // ?? + @"file-count": ?usize = null, + + // ?? TODO: this is most likely outdated, the returned json is missing + // some of the fields in the docs + files: ?[]struct { + bytesCompleted: ?u64 = null, + length: ?u64 = null, + name: ?[]u8 = null, + beginPiece: ?u32 = null, + endPiece: ?u32 = null, + } = null, + + //fileStats array (see below) n/a + group: ?[]u8 = null, hashString: ?[]u8 = null, |