mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Implement sync/torrent_peers request
This commit is contained in:
@@ -82,6 +82,7 @@ QMap<QString, QMap<QString, WebApplication::Action> > WebApplication::initialize
|
||||
ADD_ACTION(query, propertiesWebSeeds);
|
||||
ADD_ACTION(query, propertiesFiles);
|
||||
ADD_ACTION(sync, maindata);
|
||||
ADD_ACTION(sync, torrent_peers);
|
||||
ADD_ACTION(command, shutdown);
|
||||
ADD_ACTION(command, download);
|
||||
ADD_ACTION(command, upload);
|
||||
@@ -277,6 +278,19 @@ void WebApplication::action_sync_maindata()
|
||||
session()->syncMainDataLastAcceptedResponse), Http::CONTENT_TYPE_JSON);
|
||||
}
|
||||
|
||||
// GET param:
|
||||
// - hash (string): torrent hash
|
||||
// - rid (int): last response id
|
||||
void WebApplication::action_sync_torrent_peers()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
print(btjson::getSyncTorrentPeersData(request().gets["rid"].toInt(),
|
||||
request().gets["hash"],
|
||||
session()->syncTorrentPeersLastResponse,
|
||||
session()->syncTorrentPeersLastAcceptedResponse), Http::CONTENT_TYPE_JSON);
|
||||
}
|
||||
|
||||
|
||||
void WebApplication::action_version_api()
|
||||
{
|
||||
CHECK_URI(0);
|
||||
|
||||
Reference in New Issue
Block a user