class

QBittorrent::Api::Sync

Inherits Reference < Object

The sync endpoint group (/api/v2/sync/, see ext/api-map.md §2.3): the delta-based main-data and per-torrent peer feeds that back the WebUI.

Both endpoints are incremental: pass the rid from the previous response into the next call and the server returns only what changed since then (full_update: true marks a complete payload). On the first call omit rid (defaults to 0 server-side) to receive a full snapshot.

Built on the Client request helpers; construct it with a client:

sync = QBittorrent::Api::Sync.new(client)
data = sync.maindata                 # full snapshot (rid defaults to 0)
delta = sync.maindata(rid: data.rid) # only what changed since `data`
peers = sync.torrent_peers(hash)

Constructors

new(client : Client)
Source

Instance methods

maindata(rid : Int64 | Nil = nil) : Model::MainData

GET sync/maindata — the main-data snapshot/delta as a MainData.

rid is the response id from the previous call; omit it (or pass nil) on the first call to request a full update.

Source
torrent_peers(hash : String, rid : Int64 | Nil = nil) : Model::TorrentPeersData

GET sync/torrentPeers — the peer list for the torrent hash as a TorrentPeersData.

rid is the response id from the previous call; omit it (or pass nil) on the first call to request a full update. Raises ApiError (HTTP 404) if hash is unknown.

Source