fix(externalapi): clear cache after a request is made (#1217)

This PR clears the Radarr/Sonarr cache after a request has been made, because the media status on
Radarr/Sonarr will no longer be good. It also resolves a bug that prevented the media from being
deleted after a request had been sent to Radarr/Sonarr.

fix #1207
This commit is contained in:
Gauthier
2025-01-02 16:44:46 +01:00
committed by GitHub
parent ac908026db
commit f718cec23f
4 changed files with 66 additions and 0 deletions

View File

@@ -293,6 +293,14 @@ class ExternalAPI {
return data;
}
protected removeCache(endpoint: string, params?: Record<string, string>) {
const cacheKey = this.serializeCacheKey(endpoint, {
...this.params,
...params,
});
this.cache?.del(cacheKey);
}
private formatUrl(
endpoint: string,
params?: Record<string, string>,