Add pause/resume, enchance tora-cli

This commit is contained in:
Alexander
2026-07-03 19:10:26 +02:00
parent 80ebf1cb63
commit 0036b19612
19 changed files with 2796 additions and 241 deletions
+32 -1
View File
@@ -3,12 +3,18 @@ syntax = "proto3";
package torrent;
service Torrents {
// Add a torrent from a magnet link and start downloading it.
// Add a torrent from a magnet link or .torrent file and start downloading it.
rpc Add(AddRequest) returns (AddResponse);
// Get the current status of a single torrent.
rpc Status(StatusRequest) returns (TorrentStatus);
// List all torrents known to the daemon.
rpc List(ListRequest) returns (ListResponse);
// Remove a torrent from tracking.
rpc Remove(RemoveRequest) returns (RemoveResponse);
// Pause a downloading torrent.
rpc Pause(PauseRequest) returns (PauseResponse);
// Resume a paused torrent.
rpc Resume(ResumeRequest) returns (ResumeResponse);
}
message AddRequest {
@@ -31,6 +37,25 @@ message ListResponse {
repeated TorrentStatus torrents = 1;
}
message RemoveRequest {
string id = 1;
bool delete_files = 2;
}
message RemoveResponse {}
message PauseRequest {
string id = 1;
}
message PauseResponse {}
message ResumeRequest {
string id = 1;
}
message ResumeResponse {}
enum State {
STATE_UNSPECIFIED = 0;
PENDING = 1;
@@ -50,4 +75,10 @@ message TorrentStatus {
uint64 downloaded_bytes = 7;
State state = 8;
string error_message = 9;
uint64 download_speed_bps = 10;
uint64 eta_seconds = 11;
uint64 uploaded_bytes = 12;
uint64 upload_speed_bps = 13;
uint32 peers = 14;
uint32 seeds = 15;
}