fix(retrievers): Use unique key to prevent Sonarr/Radarr collision
All checks were successful
Build and Push Docker Image / build (push) Successful in 33s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m10s
CI / Security audit (push) Successful in 1m33s
CI / Tests & coverage (push) Successful in 1m52s

When Sonarr and Radarr had the same instance ID (e.g., 'i3omb'),
the Radarr retriever would overwrite the Sonarr retriever in the Map.
This caused webhook refreshes to show '0 instance(s)' for Sonarr.

Now uses ':' as the unique key so both can coexist.
This commit is contained in:
2026-05-19 21:36:20 +01:00
parent ccc3b6ffec
commit 5159a83475

View File

@@ -51,8 +51,9 @@ const arrRetrieverRegistry = {
}
const retriever = new RetrieverClass(config);
this.retrievers.set(config.id, retriever);
logToFile(`[ArrRetrieverRegistry] Created ${config.type} retriever: ${config.name} (${config.id})`);
const uniqueKey = `${config.type}:${config.id}`;
this.retrievers.set(uniqueKey, retriever);
logToFile(`[ArrRetrieverRegistry] Created ${config.type} retriever: ${config.name} (${uniqueKey})`);
} catch (error) {
logToFile(`[ArrRetrieverRegistry] Failed to create retriever ${config.id}: ${error.message}`);
}