class

ArrJanitor::Config::Backend

Inherits JSON::Serializable < YAML::Serializable < Reference < Object

A single Sonarr/Radarr instance to watch.

Constants

DEFAULT_INTERVAL = 20.minutes

Interval when none is configured.

DEFAULT_METADATA_DOWNLOADING_TIMEOUT = 15.minutes

Timeout when cleanup.metadata_downloading.timeout is omitted.

DEFAULT_STALLED_TIMEOUT = 60.minutes

Timeout when cleanup.stalled.timeout is omitted.

INTERVAL_PATTERN = /\A(\d+)([mhd])\z/

<int> followed by a m/h/d unit.

Constructors

new(name : String, type : BackendType | Nil, url : String, api_key : String, interval : String | Nil = nil, extensions_filter : Array(String) = [] of String, download_clients : Array(DownloadClient) = [] of DownloadClient, cleanup : Cleanup | Nil = nil)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

api_key
Source
api_key=(api_key : String)
Source
cleanup

Optional cleanup rules. nil means both kinds use their defaults.

Source
cleanup=(cleanup : Cleanup | Nil)

Optional cleanup rules. nil means both kinds use their defaults.

Source
download_clients
Source
download_clients=(download_clients : Array(DownloadClient))
Source
extensions_filter
Source
extensions_filter=(extensions_filter : Array(String))
Source
interval
Source
interval=(interval : String | Nil)
Source
interval_span

The poll interval as a Time::Span. Defaults to DEFAULT_INTERVAL when unset; raises Config::Error on a malformed value.

Source
matches_bad_extension?(filename : String) : Bool

Whether filename matches any entry in extensions_filter. An entry containing a glob metachar (*, ?, [) is matched as a glob against the basename (case-insensitive); otherwise it is treated as an extension matching files ending in .<entry> (case-insensitive; a leading . is tolerated).

Source
metadata_downloading_enabled?

Whether metadata-downloading cleanup is on. Defaults to true when cleanup or the nested rule is omitted.

Source
metadata_downloading_timeout

How long a torrent may sit in metadata-downloading before cleanup. Defaults to DEFAULT_METADATA_DOWNLOADING_TIMEOUT; raises Config::Error on a malformed value.

Source
name
Source
name=(name : String)
Source
stalled_enabled?

Whether stalled-torrent cleanup is on. Defaults to true when cleanup or the nested rule is omitted.

Source
stalled_timeout

How long a torrent may sit stalled (zero seeds) before cleanup. Defaults to DEFAULT_STALLED_TIMEOUT; raises Config::Error on a malformed value.

Source
type

Parsed leniently so an unknown value surfaces as a validation error rather than a parse crash. nil means the raw value was invalid.

Source
type=(type : BackendType | Nil)

Parsed leniently so an unknown value surfaces as a validation error rather than a parse crash. nil means the raw value was invalid.

Source
url=(url : String)
Source

Nested types