fix(servarr): merge series tags instead of overwriting them (#4019)

* Merge series tags instead of overwriting when adding a series that already exists

Currently, a request coming in for a series that already exists in sonarr nukes the tags in sonarr for the series in favor of the tags coming from overseerr. This change merges the two lists of tags and deduplicates them before sending them to sonarr.

* fix(servarr api): merge request media tags with servarr instead of overwriting

---------

Co-authored-by: Danshil Kokil Mungur <me@danshilm.com>
This commit is contained in:
Andrew Kennedy
2025-03-04 11:56:40 -08:00
committed by GitHub
parent db06f8cf07
commit 30949358f4
2 changed files with 5 additions and 2 deletions

View File

@@ -188,7 +188,9 @@ class SonarrAPI extends ServarrBase<{
// If the series already exists, we will simply just update it
if (series.id) {
series.monitored = options.monitored ?? series.monitored;
series.tags = options.tags ?? series.tags;
series.tags = options.tags
? Array.from(new Set([...series.tags, ...options.tags]))
: series.tags;
series.seasons = this.buildSeasonList(options.seasons, series.seasons);
const newSeriesResponse = await this.axios.put<SonarrSeries>(