Repository navigation
feat(api): restore ratingscombined and add overrideRule/advancedRequest - #45
Conversation
|
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 2 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
|
ff0677b to
ab11602
Compare
|
Rebased onto #46 and retargeted to its branch (stack: Resolution: the rule matching stays in
🤖 Generated with Claude Code |
Two Seerr /api/v1 operations were missing from Foreseerr:
- GET /movie/{movieId}/ratingscombined, documented again as upstream
documents it and answered from the combined ratings Foreseerr already
serves with movie details (RT and IMDb, MDBList when configured);
404 "No ratings found." when no source knows the title.
- POST /overrideRule/advancedRequest: what the override rules would set
for a title, server and requester, for advanced requesters and request
managers, with the request and request-user permission checks of
upstream. Rule evaluation moves out of request creation into
routes/overriderule.rs so both use it; empty genre/language/keyword
values no longer count toward a rule's specificity. The /overrideRule
mount no longer requires ADMIN for unknown subpaths, as each route
checks its own permission.
Ported from seerr-team#2164.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The advanced requester asks /overrideRule/advancedRequest for the root folder, quality profile and tags the rules pick for the title, server and requester, and preselects them unless the edited request already set them. Ported from seerr-team#2164. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ab11602 to
a1889a4
Compare
Description
Two upstream Seerr
/api/v1operations were missing from Foreseerr. This PR adds both, so Foreseerr is back to matching upstream's API at the operation level.GET /api/v1/movie/{movieId}/ratingscombined(restored)upstream/develop:seerr-api.yml. It was removed in7e8a6a5c5.movie::combined_ratings: any signed-in user can call it. It reusesRatings::combined, the same RT + IMDb ratings that movie details already return. Statuses: 200; 404No ratings found.; 500Unable to retrieve movie ratings.when TMDB or RT/IMDb fail.providerkey, and when MDBList is configured the ratings come from MDBList (with extrametacritic/traktkeys), matching what Foreseerr's own Node route did before it was removed. Upstream'srt/imdbshapes are unchanged.POST /api/v1/overrideRule/advancedRequest(new, ported from seerr-team#2164)routes/overriderule.rs:REQUEST_ADVANCEDorMANAGE_REQUESTS.Request not found.You do not have permission to modify this request.You do not have permission to modify the request user.(choosing another requester needs bothMANAGE_USERSandMANAGE_REQUESTS)Media not foundwhen TMDB fails.Unable to evaluate override rules.{rootFolder, profileId, tags}./overrideRulemount guard drops ADMIN (standalone/fallback.rs). Every existing override-rule route already checks ADMIN itself.requestUsergives a 500, matching upstream'sfindOneOrFailpath rather than the spec's 404.serviceId: nullmeans the default server. Upstream passesnullto TypeORM, which drops it from thewhereand would match every rule.fix/upstream-backend-sync.Frontend (seerr-team#2164)
AdvancedRequestergetstmdbId/requestIdprops. It asks the new route for the rules' folder, profile and tags, and preselects them unless the request being edited already set them. On failure it shows the generic error toast.tmdbId/requestId.hasPermission([...], { type: 'or' })instead of two separate checks.OverrideRulesResultmoves toshared/interfaces/api/overrideRuleInterfaces.ts.seerr-api.ymlchanged, sobackend-rs/src/standalone/apiroutes.rswas regenerated.How Has This Been Tested?
backend-rs:cargo fmt --check,cargo clippy --all-targets --locked -- -D warningsandcargo test --lockedall pass. 707 passed: 698 ondevelop, plus 9 new tests. Therule_numberstest moved to the new module and is not counted.overriderule.rs, 6 tests: permission gate (plain user and anonymous refused, manager and advanced user allowed); default server's most specific rule with tags merged once; chosen server,serviceId: null, and anime TV only matching anime-keyword rules; picking another requester (refused for advanced users and for managers withoutMANAGE_USERS, 500 for an unknown user); existing requests (404, 403 on someone else's, managers allowed, user change refused without both permissions); bad bodies get 400.movie.rs, 3 tests:ratingscombinedrefuses anonymous callers; RT + IMDb happy path; 404No ratings found.routes::testkit, against a scratch SQLite DB with TMDB/RT/IMDb answers pre-cached, so no network is used.bun run typecheck,bun run lint(0 errors; the 5 warnings are in files this PR doesn't touch),bun run test(68 pass),bun run format:check.bun run i18n:extractgives noen.jsonchange.bun run build.Checklist:
bun run buildbun run i18n:extract🤖 Generated with Claude Code