1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

A few improvements in storage-daemon-cli interface (#570)

* Pause and resume upload in storage-daemon

* Update help

* Update LoadSpeed.cpp

* Fix json output, prohibit torrents without files

Co-authored-by: SpyCheese <mikle98@yandex.ru>
Co-authored-by: Andrey Pfau <andreypfau@ton.org>
This commit is contained in:
EmelyanenkoK 2022-12-24 13:10:09 +03:00 committed by GitHub
parent 1a07edfed4
commit b88eda83fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View file

@ -774,6 +774,8 @@ class StorageDaemonCli : public td::actor::Actor {
td::TerminalIO::out() << "\t--json\tOutput in json\n";
td::TerminalIO::out() << "download-pause <bag>\tPause download of <bag>\n";
td::TerminalIO::out() << "download-resume <bag>\tResume download of <bag>\n";
td::TerminalIO::out() << "upload-pause <bag>\tPause upload of <bag>\n";
td::TerminalIO::out() << "upload-resume <bag>\tResume upload of <bag>\n";
td::TerminalIO::out() << "priority-all <bag> <p>\tSet priority of all files in <bag> to <p>\n";
td::TerminalIO::out() << "\tPriority is in [0..255], 0 - don't download\n";
td::TerminalIO::out() << "priority-idx <bag> <idx> <p>\tSet priority of file #<idx> in <bag> to <p>\n";
@ -856,6 +858,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
td::TerminalIO::out() << "Bag created\n";
@ -888,6 +891,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
td::TerminalIO::out() << "Bag added\n";
@ -921,6 +925,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
td::TerminalIO::out() << "Bag added\n";
@ -939,6 +944,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
td::actor::send_closure(SelfId, &StorageDaemonCli::print_torrent_list, R.move_as_ok(), with_hashes);
@ -956,6 +962,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
td::actor::send_closure(SelfId, &StorageDaemonCli::print_torrent_full, R.move_as_ok());
@ -994,6 +1001,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
auto obj = R.move_as_ok();
@ -1260,6 +1268,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
auto params = R.move_as_ok();
@ -1325,6 +1334,7 @@ class StorageDaemonCli : public td::actor::Actor {
}
if (json) {
print_json(R.ok());
td::actor::send_closure(SelfId, &StorageDaemonCli::command_finished, td::Status::OK());
return;
}
auto info = R.move_as_ok();