Make *arr retrieval process pluggable to support future enhancements #19
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
While the Pluggable Download Client Architecture (PDCA) has successfully unified download-client handling (see #18), Sonarr and Radarr data retrieval remains hardcoded with direct Axios calls inside
poller.js(andhistoryFetcher.js).This tight coupling makes it difficult to introduce alternative retrieval strategies (such as event-driven listeners) without duplicating logic, risking regressions, or bloating the poller.
Goal
Introduce a clean, pluggable abstraction layer for all Sonarr and Radarr data retrieval that mirrors the PDCA pattern already used for download clients.
This refactor must:
poller.js.Scope
ArrRetrieverabstract base class / interface (inserver/clients/) with core methods:getTags(instance)getQueue(instance)getHistory(instance, options?)server/utils/arrRetrievers.js) modeled exactly afterDownloadClientRegistry.PollingSonarrRetrieverPollingRadarrRetrieverpoller.js(and affected parts ofhistoryFetcher.js) into these new classes.poller.jsto use the registry generically (in the same style as download clients).Normalized Data Requirements
All retrievers must return data in exactly the same shape and cache-key format currently used by the poller (no changes to existing cache keys, TTLs, or downstream consumers).
Success Metrics
poller.jsbecomes noticeably smaller and focused only on orchestration.Notes