Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ For local MCP access, see the [SnapeTech MCP integration guide](./docs/integrati
- Labeled movie and TV request destinations across multiple Radarr and Sonarr instances, with per-user access and availability tracked for each destination.
- Managers can approve a one-time movie or TV request exception when a user's quota is full; optional Slack actions use a mapped account and the same request permissions as the web app.
- Automation service integration with Radarr, Sonarr, Lidarr, and Bookshelf/Readarr-compatible APIs.
- Optional per-instance Radarr/Sonarr tag exclusions for library scans, with existing request history preserved and non-excluded service copies still counted.
- Sonarr v5 support alongside v3/v4, including metadata-language and season-order options with explicit season mapping for recovery.
- An optional TV request gate that checks whether the previous regular season was watched through a linked Plex, Jellyfin, or Emby account.
- Admin-configured Prowlarr connection, per-indexer diagnostics, category coverage, and format-aware manual search across movies, TV, music, books, comics, magazines, ROMs, and PC games, with title-prefilled search links from media details; approved requests still go through their configured acquisition providers.
Expand Down Expand Up @@ -179,6 +180,9 @@ Recent repository updates include:
- **Sonarr:** v5 API support alongside v3/v4, metadata-language and season-order
choices, and request recovery scoped to the selected service, quality, and
season order.
- **Radarr/Sonarr sync:** administrators can omit tagged library entries from
an instance's scan without losing existing SeerrNG requests or hiding a
matching copy found on another non-excluded service.
- **Integrations:** MusicBrainz and Cover Art Archive connectivity checks with
bounded artwork traffic controls, plus a preview-first BookshelfNG to
ChaptarrNG database migration helper for single-database setups.
Expand Down
3 changes: 2 additions & 1 deletion docs/fork-rationale.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Public checklist for the behavior and release evidence needed befor

# What upstream needs before SeerrNG can disappear

**Last reviewed: October 16, 2026.**
**Last reviewed: November 1, 2026.**

SeerrNG is maintained as a separate fork so it can add cross-media workflows
and adapt selected Seerr changes for its users. This matrix records what a
Expand Down Expand Up @@ -38,6 +38,7 @@ required migration and operator path have been checked.
| Sonarr anime profiles | Administrators can set and review an anime quality profile. If that profile is missing or cannot be checked at dispatch time, an approved anime request can use the standard profile on the same Sonarr service. Source context includes Seerr [issue #3159](https://github.com/seerr-team/seerr/issues/3159) and [PR #3160](https://github.com/seerr-team/seerr/pull/3160). | Checks cover profile creation and edits, missing or unavailable profiles, recovery at dispatch, and isolation across multiple Sonarr services. |
| Sonarr future-season monitoring | Administrators can choose All, None, or Latest Season Requested. The last mode monitors future seasons only when a request includes the latest regular season; specials and older-only requests do not qualify. Automatic search remains separate. Source context includes Seerr [issue #3152](https://github.com/seerr-team/seerr/issues/3152) and [PR #3157](https://github.com/seerr-team/seerr/pull/3157). | Checks cover latest, older-only, special-only, and missing-season metadata, and confirm the setting round-trips while automatic-search behavior remains independent. |
| Sonarr API and season orders | Sonarr v3/v4 and v5 remain supported. For v5, metadata language and season order are explicit request choices; manual season repair verifies standard seasons against TVDB and alternate orders against the selected Sonarr series. | Checks cover version detection, per-endpoint fallback, focused updates that preserve Sonarr-owned metadata, and mappings isolated by service, quality, and season order. |
| Radarr/Sonarr scan tag exclusions | Administrators can exclude tagged library entries from one Radarr or Sonarr scan without treating an excluded copy as available on that instance. Existing SeerrNG media records and requests remain intact; title-wide availability is cleared only when the excluded instance was its recorded source and no alternate copy is known. Source context includes Seerr [PR #1884](https://github.com/seerr-team/seerr/pull/1884), which closed without merging. | Checks cover optional settings round-trip and validation, legacy settings, complete scans where every item is excluded, destination and title-wide status reconciliation without request loss, safe orphan cleanup, duplicate endpoint settings, and matching items on non-excluded instances. Media-server availability remains governed by its own recorded identity. |
| Request destinations and variants | Movie and series requests can target labeled Radarr and Sonarr instances. Per-user grants, quality choices, destination-specific availability, and request history stay attached to the selected service. Other media preserve selected book format, game platform, and other request variants. Source context includes Seerr [PR #3560](https://github.com/seerr-team/seerr/pull/3560). | Checks cover permission enforcement, duplicate prevention, multiple services, scans, retries, and availability on each selected destination. |
| Previous-season watch gate | Administrators can require playback of the immediately previous regular TV season before later seasons are requested. The requester’s linked Plex, Jellyfin, or Emby watch history is used; uncertain playback state fails closed, and authorized managers can override the gate. Source context includes Seerr [issue #3590](https://github.com/seerr-team/seerr/issues/3590). | Checks cover partial and full-season requests, specials and empty seasons, missing library or playback data, watch-state changes, and permission-checked overrides. |
| Watchlist filters and ordering | Local watchlists support title search, media-type filters, and stable sorting. Combined Plex lists retain Plex order and do not claim that remote pages were fully filtered or sorted. Deliberate Plex Watchlist removals do not trigger repeated auto-requests while the item remains removed. Source context includes Seerr [PR #3506](https://github.com/seerr-team/seerr/pull/3506). | Checks cover user isolation, pagination, local ordering, combined Plex results, and the remove/re-add auto-request cycle. |
Expand Down
17 changes: 17 additions & 0 deletions docs/using-seerr/settings/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ If the hostname or IP address you configured above is not accessible outside you

Enable this setting if you would like to scan your Radarr/Sonarr server for existing media/request status. It is recommended that you enable this setting, so that users cannot submit requests for media which has already been requested or is already available.

#### Exclude Tags from Scan (optional)

After testing the connection, select any Radarr or Sonarr tags whose matching
movies or series should be omitted from that service's SeerrNG scan. A matching
item is marked unknown for that instance, so it will not block a request to the
same destination. Existing SeerrNG media records and requests are retained. If
that instance was the only recorded source, its title-wide availability is also
cleared; a matching copy on another non-excluded service can still count as
available. If the same endpoint is configured more than once, its active
entries share one scan and their excluded tags are combined.

This setting only changes the Radarr or Sonarr scan. Other configured services
can still report the same media as available, including in Discover's Recently
Added shelf when a media-server integration reports it. Existing settings
files need no migration; an omitted exclusion list behaves as empty. The
feature is inactive until **Enable Scan** is selected.

#### Enable Automatic Search (optional)

Enable this setting to have Radarr/Sonarr to automatically search for media upon approval of a request.
Expand Down
9 changes: 9 additions & 0 deletions release-notes/2026-11-01-radarr-sonarr-sync-tag-exclusions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
category: changed
audience: users, operators
area: servarr
action: none
breaking: false
---

Administrators can exclude tagged Radarr or Sonarr library entries from scans while SeerrNG preserves existing requests and still recognizes non-excluded copies on other configured services.
16 changes: 16 additions & 0 deletions seerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3254,6 +3254,14 @@ components:
syncEnabled:
type: boolean
example: false
syncExcludedTags:
type: array
maxItems: 100
items:
type: integer
minimum: 0
maximum: 1000000
description: Servarr tag IDs excluded from this Radarr library scan.
preventSearch:
type: boolean
example: false
Expand Down Expand Up @@ -3763,6 +3771,14 @@ components:
syncEnabled:
type: boolean
example: false
syncExcludedTags:
type: array
maxItems: 100
items:
type: integer
minimum: 0
maximum: 1000000
description: Servarr tag IDs excluded from this Sonarr library scan.
preventSearch:
type: boolean
example: false
Expand Down
28 changes: 28 additions & 0 deletions server/lib/externalRuntimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,39 @@ const normalizeServarrServices = (
);
}

const supportsSyncExcludedTags =
service === 'radarr' || service === 'sonarr';
const syncExcludedTags = settings.syncExcludedTags;
if (
supportsSyncExcludedTags &&
syncExcludedTags !== undefined &&
(!Array.isArray(syncExcludedTags) ||
syncExcludedTags.length > 100 ||
syncExcludedTags.some(
(tagId) =>
typeof tagId !== 'number' ||
!Number.isSafeInteger(tagId) ||
tagId < 0 ||
tagId > 1_000_000
))
) {
throw new Error(
`SEERR_EXTERNAL_CONFIG.${service}[${index}].syncExcludedTags is invalid`
);
}

return {
...settings,
// Older settings files omitted this field or stored it as null. Both
// representations mean the standard (non-4K) service.
is4k: settings.is4k === true,
...(supportsSyncExcludedTags
? {
syncExcludedTags: Array.isArray(syncExcludedTags)
? [...new Set(syncExcludedTags)]
: [],
}
: {}),
};
});
};
Expand Down
169 changes: 169 additions & 0 deletions server/lib/scanners/excludedServarrAvailability.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import { MediaStatus, MediaType } from '@server/constants/media';
import dataSource from '@server/datasource';
import Media from '@server/entity/Media';
import MediaServiceStatus, {
type VideoRequestServiceType,
} from '@server/entity/MediaServiceStatus';
import { In } from 'typeorm';

export type ExcludedServarrAvailabilitySource = {
mediaId: number;
serverId: number;
format: 'standard' | '4k';
};

const libraryAvailabilityStatuses = new Set([
MediaStatus.AVAILABLE,
MediaStatus.PARTIALLY_AVAILABLE,
MediaStatus.PROCESSING,
]);

const reportedAvailabilityStatuses = new Set([
MediaStatus.AVAILABLE,
MediaStatus.PARTIALLY_AVAILABLE,
]);

export const reconcileExcludedServarrAvailability = async (
serviceType: Extract<VideoRequestServiceType, 'radarr' | 'sonarr'>,
sources: readonly ExcludedServarrAvailabilitySource[]
): Promise<void> => {
const sourcesByMedia = new Map<number, Map<'standard' | '4k', Set<number>>>();
const statusUpdates = new Map<
string,
{ serverId: number; format: 'standard' | '4k'; mediaIds: Set<number> }
>();

for (const source of sources) {
const formats = sourcesByMedia.get(source.mediaId) ?? new Map();
const serverIds = formats.get(source.format) ?? new Set<number>();
serverIds.add(source.serverId);
formats.set(source.format, serverIds);
sourcesByMedia.set(source.mediaId, formats);

const key = `${source.serverId}:${source.format}`;
const update = statusUpdates.get(key) ?? {
serverId: source.serverId,
format: source.format,
mediaIds: new Set<number>(),
};
update.mediaIds.add(source.mediaId);
statusUpdates.set(key, update);
}

if (sourcesByMedia.size === 0) {
return;
}

await dataSource.transaction(async (manager) => {
const serviceStatusRepository = manager.getRepository(MediaServiceStatus);
for (const { serverId, format, mediaIds } of statusUpdates.values()) {
await serviceStatusRepository.update(
{
mediaId: In([...mediaIds]),
serviceType,
serverId,
format,
},
{
status: MediaStatus.UNKNOWN,
externalServiceId: null,
externalServiceSlug: null,
seasonStatuses: null,
}
);
}

const mediaRepository = manager.getRepository(Media);
const mediaItems = await mediaRepository.find({
where: { id: In([...sourcesByMedia.keys()]) },
relations: { seasons: true, serviceStatuses: true },
});

for (const media of mediaItems) {
let changed = false;
const sourcesByFormat = sourcesByMedia.get(media.id);
if (!sourcesByFormat) continue;

for (const format of ['standard', '4k'] as const) {
const excludedServerIds = sourcesByFormat.get(format);
if (!excludedServerIds?.size) continue;

const is4k = format === '4k';
const serviceIdField = is4k ? 'serviceId4k' : 'serviceId';
const currentServiceId = media[serviceIdField];
if (
currentServiceId == null ||
!excludedServerIds.has(currentServiceId)
) {
continue;
}

const formatStatuses = (media.serviceStatuses ?? []).filter(
(status) =>
status.serviceType === serviceType &&
status.format === format &&
!excludedServerIds.has(status.serverId)
);
const alternativeAvailability = formatStatuses
.filter((status) => reportedAvailabilityStatuses.has(status.status))
.sort((left, right) => {
const rank = (status: MediaStatus): number =>
status === MediaStatus.AVAILABLE ? 0 : 1;
return rank(left.status) - rank(right.status);
})[0];
const hasMediaServerCopy = is4k
? Boolean(media.ratingKey4k || media.jellyfinMediaId4k)
: Boolean(media.ratingKey || media.jellyfinMediaId);
const statusField = is4k ? 'status4k' : 'status';

if (!hasMediaServerCopy) {
if (alternativeAvailability) {
if (
media[statusField] !== MediaStatus.BLOCKLISTED &&
media[statusField] !== MediaStatus.DELETED &&
media[statusField] !== MediaStatus.PENDING
) {
media[statusField] = alternativeAvailability.status;
}
} else if (libraryAvailabilityStatuses.has(media[statusField])) {
media[statusField] = MediaStatus.UNKNOWN;
}

if (media.mediaType === MediaType.TV) {
for (const season of media.seasons ?? []) {
const nextStatus = alternativeAvailability
? (alternativeAvailability.seasonStatuses?.[
season.seasonNumber
] ?? MediaStatus.UNKNOWN)
: MediaStatus.UNKNOWN;
if (season[statusField] !== nextStatus) {
season[statusField] = nextStatus;
}
}
}
}

if (alternativeAvailability) {
const externalServiceIdField = is4k
? 'externalServiceId4k'
: 'externalServiceId';
const externalServiceSlugField = is4k
? 'externalServiceSlug4k'
: 'externalServiceSlug';
media[serviceIdField] = alternativeAvailability.serverId;
media[externalServiceIdField] =
alternativeAvailability.externalServiceId ?? null;
media[externalServiceSlugField] =
alternativeAvailability.externalServiceSlug ?? null;
} else {
media.resetServiceDataForResolution(is4k, true);
}
changed = true;
}

if (changed) {
await mediaRepository.save(media);
}
}
});
};
Loading