class

ArrJanitor::DownloadClient

Inherits Reference < Object

Abstraction over a download client (qBittorrent, ...) able to list the file paths contained in a torrent, identified by its hash, and return a small client-agnostic snapshot of its state.

Concrete implementations live as nested classes (see QBittorrent); build one from a Sonarr/Radarr download-client implementation name plus the matched credentials via .build.

Class methods

build(implementation : String, base_url : String, api_key : String | Nil, username : String | Nil, password : String | Nil) : DownloadClient | Nil

Builds a DownloadClient for the *arr download-client implementation.

Only qbittorrent (case-insensitive) is supported; it requires both username and password (its WebUI has no API key) and raises Error when either is missing. Returns nil for any other implementation so the caller can log and skip it.

Source

Instance methods

files_for(hash : String) : Array(String)

Returns the file paths (each relative to the torrent root) inside the torrent identified by hash.

Source
info_for(hash : String) : TorrentSnapshot

Returns a snapshot of the torrent identified by hash (state, currently connected seeds, added-on time).

Source

Nested types