Repository navigation
fix(backend-rs): port upstream Seerr backend fixes through af0356245 - #46
Conversation
…ponses
A user embedded in another entity's response (a request's requestedBy and
modifiedBy, an issue's users, an issue comment's user, watchlist and push
subscription users, the bulk permission update) carried its eager settings
relation, exposing Pushover, Pushbullet, Telegram, Discord and PGP values.
Nested users now serialize like Node's User.toJSON, without settings; only
a top-level User.filter(true) (own profile, user manager) still includes
them, and /auth/me already sends its own allowlist.
GET /movie/{id} and GET /tv/{id} returned mediaInfo with every requester's
email and Plex id and the full issues, comments included, to any signed-in
user. Requests' users now go through User.filter(), and issues are only
included for viewers with an issue permission, without comments or the
problem season and episode.
Ported from seerr-team/seerr 53e77bf (GHSA-8j73-j6rc-q8xh) and
9fda1c6 (GHSA-xc6j-6p6h-p799).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…outing POST /request took serverId, profileId, rootFolder, languageProfileId, metadataLanguageId and tags from any requester, and PUT /request let a series owner change them, although only MANAGE_REQUESTS or REQUEST_ADVANCED may pick where a request goes. Those fields are now ignored for everyone else. A requested server must be a configured server of the request's quality; otherwise the request goes to the default server without the requested options, and sending a request whose stored serverId is no server of its quality falls back to the default server and its settings. Override rules now match the server the request is sent to rather than always the default one, and apply to advanced requesters too, filling in only what they left unset. A series edit without seasons answers 400 instead of 500. Ported from seerr-team#3674, seerr-team#3538 and seerr-team#3539. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… request PUT /request credited the request's own quota units back even when they were never counted: when the request moves to another owner, or was created before the owner's quota window. It now credits them only when the owner's quota counted them, and moving a movie request onto another user answers 403 when their movie quota is spent. A series edit could add seasons the library already has; those are now left out unless the request already holds them, and the quota is charged for the seasons the request ends up with. Edits now take the same lock as request creation, so an edit and a new request can't claim the same season or quota at once. Ported from seerr-team#3378, seerr-team#3379 and seerr-team#3380. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job runs every few minutes (every 3 by default), but the jobs list reported a seconds interval, so the schedule editor offered 30, 45 and 60 seconds. It now reports minutes, and the editor offers 3 minutes too. Ported from seerr-team#3593. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th Plex With users already in the database but no media server configured (a restored database, say), the admin's Plex sign-in left the server type unset, so the Plex jobs never ran. Signing in as the admin now sets it to Plex and starts the jobs again. Starting the jobs a second time now drops the earlier schedule and schedules every job for the new server, where it used to do nothing. Ported from seerr-team#3652. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Requesting an unreleased movie already in Radarr triggered a search Radarr can't act on. The search now only runs when Radarr reports the movie as available; Radarr searches by itself once it is. Ported from seerr-team#3533. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /request?sort=added (the spec's default) ordered by id, and requests tied on the sort column came back in an arbitrary order. "added" now orders by createdAt, and both sorts break ties by id in the same direction, which also makes the Postgres-only reordering pass that reproduced the tied order unnecessary. Ported from seerr-team#3589. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An answer from Plex Discover without a usable MediaContainer (an error body, say) was cached with its ETag, so every later fetch was answered 304 and kept failing. Only a valid page is cached now, a cached invalid one is dropped before it is revalidated, and items listed under Video are read too. The metadata of every item on the page was fetched at once; at most five are fetched at a time now, and an item whose fetch times out or can't connect is skipped instead of emptying the whole page. Ported from seerr-team#3406 and seerr-team#3251. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /watchlist was documented as taking a whole Watchlist entity and answering 200; it takes tmdbId and mediaType (required), ratingKey and title, and answers 201. With the spec validator on, a body without tmdbId or mediaType is now refused with a 400. Ported from seerr-team#3425. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jellyfin's recently added list returns seasons and episodes when only new episodes of a show were added; the scan skipped those, so the show's new episodes weren't picked up until the full scan. A season or episode now scans the series it belongs to. Ported from seerr-team#3551. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d pursuing When a Radarr movie or Sonarr season that was processing turned unmonitored with nothing downloaded, the scan reset it to unknown but left its approved requests approved, so the title could not be requested again. The reset also depended on which server was scanned first: one server could reset a title another still pursued, and an abandoned entry claimed the title's service ids. The Radarr and Sonarr scans now leave such titles and seasons as they are until every server was scanned. A title or season no server pursues, and that no server failed to scan, then falls back to unknown; a title's approved requests are declined, and a series request loses the abandoned seasons (keeping its quota units in step), is completed when its remaining seasons are, and is declined when all its seasons are gone. Ported from seerr-team#3578 and seerr-team#3579. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plex.tv intermittently answers 404 while polling a PIN that is still valid, which aborted the Plex sign-in. The poll now retries those until the PIN's deadline. Ported from seerr-team#3599. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ported from seerr-team/seerr f88515b (Weblate). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…swer POST /request answered with the title's media and its other requests, each with its requester's email and Plex id. Those users now go through User.filter(), as mediaInfo's do since the GHSA-xc6j-6p6h-p799 port. Upstream still sends them; this follows the advisory's intent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
Hey @selmant, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out. Issues found:
Please update your PR description to follow the PR template. This check will automatically re-run when you edit your PR description. |
Description
Ports the upstream Seerr backend fixes made after our last sync into
backend-rs. Range:59d5947b4..af0356245(upstreamdevelopheadaf0356245d95246ea4641da4e3908b02ad1b114f). I triaged all 52 upstream commits in that range. Each ported fix is its own commit, or shares one where the fixes touch the same code, and each commit message names the upstream PR or advisory it ports.Security (published upstream advisories):
settings, which hold Pushover, Pushbullet, Telegram, Discord and PGP values. The affected responses were requests, request approve/decline/edit, issues, issue comments, watchlist, Plex watchlist pages, push subscriptions and the bulkPUT /user. Nested users now serialize like Node'sUser.toJSON, so the settings are left out. They still appear inUser.filter(true)(your own profile, or a user manager's view)./auth/mealready sent its own allowlist.GET /movie/{id}andGET /tv/{id}returned, inmediaInfo, every requester's email and Plex id, plus full issues including comment bodies. Requests' users now go throughUser.filter(). Issues are only sent to viewers with an issue permission, and without comments,problemSeasonorproblemEpisode. The same filtering now also applies to the other requests embedded in thePOST /requestanswer, which upstream doesn't do yet.Requests:
MANAGE_REQUESTSorREQUEST_ADVANCEDcan choose server, profile, root folder, language profile, metadata language or tags, on create and on series edits.sort=added(the spec default) orders bycreatedAt, and both sorts break ties by id. This removes the Postgres-only tie-order emulation pass.Scanners and jobs:
tvQuotaUnitskept in step).Other: seerr-team#3425 (watchlist POST body schema and 201 in
seerr-api.yml; route table regenerated, no changes), seerr-team#3599 (frontend: plex.tv PIN 404s retried until the deadline), zh-Hant notification translations.794743a45(seerr-team#2164, override rules for advanced requests and the/overrideRule/advancedRequestendpoint) is ported separately and isn't in this PR. seerr-team#3538/seerr-team#3539/seerr-team#3674 touch the same code inroutes/requestcreate.rs(matching_rule/apply_rule), so that port will need a rebase onto this one.Triage
id.json;idisn't an available localeminutes(+ UI option)isAvailablesrc/utils/plex.tsaddedsorts bycreatedAt, id tiebreakmediaInfofilteringHow Has This Been Tested?
From
backend-rs/:cargo fmt --check,cargo clippy --all-targets --locked -- -D warningsandcargo test --lockedall pass. Tests: 698 before, 713 after (15 new). Mapping DB tests skip locally withoutFORESEERR_MAPPING_TEST_DB.mediaInfoissue gate and its fieldsbun run typecheck, ESLint and Prettier pass on the touched files.I didn't test any of this by hand against a live instance.
Checklist:
bun run buildbun run i18n:extract🤖 Generated with Claude Code