fix: correct "Remove from *arr" button (#1544)

This PR fixes the "Delete from *arr" button in the request list. It checks from the API whether the
*arr server corresponding to the request still exists before displaying the remove button, and fixes
a cache removal issue that could cause problems when deleting recently added media. This PR also
reverts #1476, which introduced problems during removal.

fix #1494
This commit is contained in:
Gauthier
2025-03-31 20:06:33 +02:00
committed by GitHub
parent 63dc27d400
commit 8dc1d8196c
8 changed files with 75 additions and 90 deletions

View File

@@ -368,14 +368,18 @@ class SonarrAPI extends ServarrBase<{
if (tvdbId) {
this.removeCache('/series/lookup', {
term: `tvdb:${tvdbId}`,
headers: this.defaultHeaders,
});
}
if (externalId) {
this.removeCache(`/series/${externalId}`);
this.removeCache(`/series/${externalId}`, {
headers: this.defaultHeaders,
});
}
if (title) {
this.removeCache('/series/lookup', {
term: title,
headers: this.defaultHeaders,
});
}
};