class

ArrJanitor::Backend

Inherits Reference < Object

Abstraction over an *arr instance (Sonarr today, Radarr later). Concrete backends wrap the corresponding client shard; callers work only with the ArrJanitor structs above.

A backend also carries its own scheduling state so the scheduler can run one fiber per backend: next_run is when the next scan is due, due? reports whether it should run now, and schedule_next advances it by the configured interval.

Instance methods

config

The Config::Backend this backend was built from. The janitor reads it for the extensions_filter matcher and download-client credentials.

Source
delete_and_blocklist(item : QueueItem) : Nil

Removes the item from its download client and blocklists it in the *arr.

Source
download_client_info(name : String) : DownloadClientInfo | Nil

Resolves connection details for the download client named name, or nil when the *arr has no such client configured.

Source
due?(now = Time.local) : Bool

Whether a scan should run now: true on the first tick (next_run unset) or once the scheduled time has been reached/passed.

Source
interval_span

Poll interval between scans.

Source
name

Human-readable backend name (from config).

Source
next_run

When the next scan is due; nil means "run on the first tick".

Source
next_run=(next_run : Time | Nil)

When the next scan is due; nil means "run on the first tick".

Source
queue

The current download queue.

Source
released?(item : QueueItem) : Bool

Whether the item's episode/movie has been released (aired/available).

Source
schedule_next(now = Time.local) : Nil

Advances next_run to now + interval_span.

Source
search(item : QueueItem) : Nil

Triggers a fresh search for the item's episode/movie.

Source