class

ArrJanitor::Janitor

Inherits Reference < Object

Processes a single backend's download queue, removing and blocklisting any download that contains a bad file extension and re-triggering a search when the episode/movie has already been released.

Download-client construction is injected via a DownloadClientResolver so the pipeline is testable offline; by default it delegates to DownloadClient.build.

Constants

DEFAULT_RESOLVER = DownloadClientResolver.new do |implementation, base_url, api_key, username, password| DownloadClient.build(implementation, base_url, api_key, username, password) end

The default resolver: delegates straight to DownloadClient.build.

Constructors

new(resolver : DownloadClientResolver = DEFAULT_RESOLVER, store : Store | Nil = nil, dry_run : Bool = false)

Optional persistence for the processed-download audit log. When nil (the default) recording is a no-op, so the pipeline runs unchanged.

When dry_run is true, the read path is unchanged but no mutation is performed: intended deletes/blocklists/searches are logged with a [DRY RUN] prefix and nothing is written to the store.

Source

Instance methods

process(backend : Backend, reporter : Reporter) : Nil

Scans backend.queue, acting on each item. Every item is processed inside its own begin/rescue, so a failure on one item is logged via reporter and the scan continues with the rest.

Source