Repository navigation
feat(ratings): let metadata plugins declare every rating beyond IMDb and TMDB - #1698
Conversation
Item detail gains a server-built `ratings` list (source, plain-text mark, 0-100 score, formatted display) that every client renders as it comes. IMDb and TMDB always show; Rotten Tomatoes and the other sources show only after an administrator lists them in catalog.extra_rating_sources, because their owners restrict display. v2 cards drop the Rotten Tomatoes scores the administrator has not turned on, so poster badges follow the same choice. The web title page, hero, sort labels, Watch Tonight, the Watch Together picker, and poster badges now show each rating as its source's mark and score, with TMDB's approved logo on title pages and heroes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A metadata plugin can now declare rating sources beyond Silo's built-in ones under rating_sources in its capability manifest (id, name, scale, percent) and report them under ratings.sources. The host keeps a declared source's scores alongside the built-in ones, and title pages list it after Silo's own sources once an administrator adds it to catalog.extra_rating_sources. A source a plugin did not declare is still dropped. GET /api/v2/admin/rating-sources lists every source an administrator can show, with the plugin that declared it, and the admin Ratings settings now read their list from it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
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 8 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (49)
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. Comment |
A title page on a phone now shows only the first three ratings in the server's order, so the row stays on one line; wider screens still show all of them. The Apple and Android apps follow the same rule, and docs/catalog-api.md records it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The admin Ratings list moves to the change that lets metadata plugins declare their own ratings, so Silo never ships a fixed list of rating sources. This change keeps the shared title-page list and the catalog.extra_rating_sources setting, which the settings API sets. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # web/src/pages/admin-settings/LibraryMetadataSettings.tsx # web/src/pages/admin-settings/ratingSources.ts
Silo now names only IMDb and TMDB. Every other rating, Rotten Tomatoes included, is one an enabled metadata plugin declares under rating_sources, with its own name, an optional longer label, and its scale. A source's scores are kept at ingest only when the sending plugin declared it, and show on title pages and poster badges only when a plugin declares it and an administrator turned it on. Scores already stored stay in place. The admin Ratings settings list the declared ratings grouped by plugin, and say so when no plugin adds any. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ache - Limit the detail's rating_sources member to the sources title pages show, in the same order as ratings, so stored scores of sources a plugin stopped declaring are never served. - Treat a percent declaration as a 0-100 scale. - Refresh the cached selection once per node, detached from the request, and do not cache a selection whose declarations were never read. - Break rating source ties by name when writing rows. - List turned-on sources no enabled plugin declares in the admin page so they can be turned off. - Normalize a plugin's source names once and drop LookupRatingSource and NormalizeRatingSource, which have no callers left. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88b01b5a58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The rating source selection and access.unrated_content now read through one config.CachedSetting (10-second cache, last good value on a failed read, no cached failure) instead of two copies of that logic. The setting's save and read paths share one tokenizer. The settings docs now say that a well-formed source name without a definition is saved but shows nothing. Format documents and tests that halves round away from zero. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Poster badges and library sort labels formatted scores with toFixed(1), which reads a stored 7.35 as "7.3" while the server's title-page display reads "7.4". Cards, badges and the hero now share one formatter that rounds halves away from zero, as ratingsources.Format does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Item detail returned rating_rt_critic, rating_rt_audience and every rating_sources row to all viewers, so a client reading those members kept showing hidden sources. They now follow the administrator's choice, except for viewers who can curate the item's metadata, whom the metadata editor serves. A browse sorted by a hidden Rotten Tomatoes score orders as if no sort was given. GET /api/v2/capabilities/ratings lists the shown sources, so clients detect the feature from a capability rather than a field's presence, and the web sort menu offers Rotten Tomatoes sorts only when that source is shown. The Watch Together picker builds only the card of each entry instead of a full detail. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Add GET /api/v2/admin/rating-sources/capabilities, which reports plugin_declared_sources, so clients detect the rating source list instead of probing its route. The admin Ratings group shows only where the node reports it. Order enabled metadata capabilities by capability ID within an installation, so which capability names a source two of them declare does not depend on the query plan. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d3c5fab83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cale rt_critic and rt_audience read the rating_rt_* columns, which hold a percentage poster badges show as is, so their declarations are always percentages. The admin Ratings text now promises poster badges only for Rotten Tomatoes, the one declared source cards carry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51c54244f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The collection editors still offered Rotten Tomatoes sorts, and the badge settings still offered Rotten Tomatoes badges, when the ratings capability did not list that source; a badge turned on there never rendered because cards leave the score out. Both now follow getRatingsCapability. An editor keeps a hidden sort that a saved collection already uses, so reopening it does not change the collection's order. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Keep this branch's policy, which also reads plugin declarations, and extend the base's Selection.Shown to list declared sources, so the ratings capability, cards and browse sorting follow plugin declarations. Keep the base's curator exception for rating_sources and order the shown rows like ratings. Base tests that relied on the removed built-in sources now declare them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A NaN score failed both range comparisons and reached the ratings list. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Saving catalog.extra_rating_sources now marks title pages, cards and the ratings capability stale right away and again once each API node's 10-second copy of the setting has expired, instead of leaving them fresh for minutes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef08dd1095
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ed value A read that failed after another caller refreshed the cache returned the snapshot taken before either read, so concurrent requests could apply different settings. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Installing, updating, enabling, disabling or removing a plugin can change the ratings metadata plugins declare. Those actions now refresh title pages, cards, the ratings capability and the admin list of rating sources, right away and after each API node's cached copy of the choice has expired, the same way saving the rating choice does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08a737830d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The server's ratings list now holds at most three entries, the first in display order, so web, Apple and Android all show the same three on one line. The web's phone-only limit is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # internal/ratingsources/ratingsources_test.go
Two reads of an expired setting could overlap. If the older one finished last, it replaced the newer value and gave it a fresh TTL, so an administrator's change could briefly revert. Each read now records when it started, and a read only caches its result if no newer read already has. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The NFO provider reads Rotten Tomatoes scores from local .nfo files into the rating columns, but only plugins could declare ratings, so those scores could never show. Built-in providers now declare their ratings in code; the NFO provider declares Rotten Tomatoes critics and audience, which an administrator can turn on like any other rating. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
When the NFO provider and MDBList both declared Rotten Tomatoes, the admin list credited only the first. A rating now names every enabled provider that declares it, such as "NFO Files and MDBList". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
# Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53b52f1448
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…declares them A plugin that never declared Rotten Tomatoes, such as an older MDBList, still filled the shared rating_rt_* columns through its flat rt_critic and rt_audience ratings. Once the NFO provider declared those sources, the plugin's scores showed under NFO's name. Flat Rotten Tomatoes scores now follow the same declaration rule as ratings.sources; IMDb and TMDB are always kept. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2106c9126
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lity ID A capability that sent an empty display_name was credited with an empty provider, so the admin page listed its rating sources under no plugin and gave them no toggle. Both capability queries now treat a blank name as missing, as the provider constructor already did. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab04bf9514
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Class: ClassActingAdmin, ServiceBacked: true, | ||
| } | ||
| Register(reg, o, func(ctx context.Context, _ *struct{}) (*AdminRatingSourceCollectionOutput, error) { | ||
| sources, err := reg.deps.RatingSources.Sources(ctx) |
There was a problem hiding this comment.
Return unavailable when the rating policy is not wired
When v2Dependencies receives no settings service, it leaves deps.RatingSources nil, but this service-backed operation still calls Sources; that method is nil-safe and returns only IMDb/TMDB, so the endpoint misleadingly responds 200 with an incomplete list instead of the documented 503 dependency_unavailable. Check the dependency before calling it, as other service-backed handlers do.
Useful? React with 👍 / 👎.
Main now holds #1697 as a squash commit, so this carries only this branch's own changes onto it. It also regenerates the v2 OpenAPI artifact, web types and contract fixtures, which went stale on main when #1697 merged after #1710 and #1731. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d397fa68b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // than a denylist of known providers because plugin watch providers store | ||
| // their own arbitrary keys in `source` — a denylist would silently count any | ||
| // newly installed provider's imported backlog as local plays. | ||
| const adminTopActivityWatchSourceFilter = `COALESCE(h.source, 'legacy') IN ('legacy', 'manual', 'playback', 'jellycompat')` |
There was a problem hiding this comment.
Exclude watch marks from activity play counts
When a user marks an item watched through Silo (manual) or Jellyfin (jellycompat), these are synthetic mark rows rather than playback, and marking a series emits one row per episode. Admitting both sources here makes queryAdminTopActivity count those marks as plays and can put an untouched series atop the title and profile leaderboards. The parent commit explicitly excluded them and covered this case with TestAdminTopActivityCountsPlaybackNotMarks, which this commit also deletes; retain only legacy and playback instead of reverting that fix.
AGENTS.md reference: AGENTS.md:L7-L9
Useful? React with 👍 / 👎.
| type RatingsCapability struct { | ||
| Capability | ||
| Sources []RatingsCapabilitySource `json:"sources" doc:"The rating sources title pages and cards show, in display order: imdb and tmdb, then each source an administrator turned on. A card or detail carries rating_rt_critic or rating_rt_audience only when its source is listed. Empty, never null"` | ||
| Sources []RatingsCapabilitySource `json:"sources" doc:"The rating sources title pages and cards show, in display order: imdb and tmdb, then each source a metadata plugin declares and an administrator turned on. A card or detail carries rating_rt_critic or rating_rt_audience only when its source is listed. Empty, never null"` |
There was a problem hiding this comment.
Separate title-only sources from card capabilities
When a plugin declares and an administrator enables a non-column source such as kinopoisk, getRatingsCapability now returns it in sources while this field promises that every listed source is shown on cards; docs/catalog-api.md also tells clients to use this list when offering rating sorts and badges. Cards and browse expose only the fixed IMDb, TMDB, and Rotten Tomatoes fields, so a contract-following client can offer a custom badge or sort for which it can never receive data. The earlier admin-page copy fix does not address this remaining API evidence; keep the card capability limited to column-backed sources or split title-page and card source lists.
AGENTS.md reference: AGENTS.md:L251-L254
Useful? React with 👍 / 👎.
* fix(admin): stop counting marked-watched titles as plays again #1698 merged from a branch that predated #1761 and put back the old admin_stats_top.go, its test, and the matching docs, so Top titles and Top profiles count `manual` and `jellycompat` marks as plays again. Marking a series watched writes one row per episode, which pushes it to the top of the list. Reapply #1761 and list its Postgres test in the DB pins, so CI fails if the test is skipped or deleted again. * docs(admin): say when a top profile falls back to its id * docs(admin): say Jellyfin playback counts toward top-activity plays Since #1768, a Jellyfin-client play writes a `playback` watch-history row through RecordPlaybackStopOnce, so it passes the leaderboard filter. Only Jellyfin mark-played actions write `jellycompat` rows. The reapplied text from #1761 predated that change and said Jellyfin playback wrote no history row. Also rewrap the two leaderboard paragraphs left with overlong lines. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Quick <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Related issue: N/A
Validation tasks: none
Stacked on #1697; review that first. The base branch is #1697's branch, so this diff shows only this change.
Silo keeps its own list of eleven rating sources (Rotten Tomatoes, Metacritic, Letterboxd, Trakt, Roger Ebert and others) and drops any other name a plugin sends. That list has two problems. A plugin for a regional or niche service, such as Kinopoisk, cannot get its scores onto a title page. And most of those sources restrict how others may display their scores, so Silo should not decide on its own which of them to offer.
This change makes Silo name only IMDb and TMDB. Every other rating comes from a metadata provider that declares it under its own name, and shows only after an administrator turns it on. Plugins declare their ratings in their manifest. The built-in NFO provider declares the Rotten Tomatoes scores it reads from local
.nfofiles.Approach
Declaring a rating. A metadata plugin lists its ratings under
rating_sourcesin its capability's manifest metadata:id: the source name;name: the plain-text mark next to the score, such asRT;label: optional, the full name in the admin list, such as "Rotten Tomatoes critics";scale: the top of the source's own scale;percent: optional, to show the 0-100 score as a percentage; the scale is then 100.rt_criticandrt_audiencename the Rotten Tomatoes scores the plugin already sends as flat ratings. They are always percentages, so a title page shows the same number as the poster badge. The key lives in the existing free-form capability metadata, so the plugin SDK and its protocol are unchanged. The host checks each entry on its own and keeps at most eight per capability. The rules are indocs/catalog-api.md.Storing scores. The host keeps a plugin's
ratings.sourcesentry only forimdb,tmdband the sources that plugin declared, and drops any other name. Scores go into the existing per-source table, so there is no migration. Scores already stored stay in the table, but the item detail'srating_sourcesmember now lists only the sources title pages show, in the same order asratings. A score a plugin reported before it stopped declaring its source, such as a stored Metacritic score, is not served; as in feat(ratings): show the same external ratings on every title page #1697, only a viewer who curates the item's metadata gets every stored source, for the metadata editor.Showing them. A declared rating appears on title pages, after IMDb and TMDB, only when an administrator lists it in
catalog.extra_rating_sources(feat(ratings): show the same external ratings on every title page #1697). Poster badges show Rotten Tomatoes only when a plugin declares it and the administrator turned it on.internal/ratingsourcesreads the declarations of enabled plugins together with the setting, cached for 10 seconds per node. When the cache expires, one read per node refreshes it for every waiting request, detached from the request that started it, and a node does not cache a selection until it has read the declarations once. When two plugins declare the same id, the first by installation order, then capability ID, names and scales it.getRatingsCapabilityfrom feat(ratings): show the same external ratings on every title page #1697 lists the declared sources an administrator turned on after IMDb and TMDB. Clients need no change: they already show an unknown source by itsname.Admin list.
GET /api/v2/admin/rating-sourceslists IMDb, TMDB and every declared rating, crediting every provider that declares it, such as "NFO Files and MDBList".GET /api/v2/admin/rating-sources/capabilitiesreportsplugin_declared_sources, and the admin page shows the Ratings group only where the node reports it. The Ratings group in Library & Metadata settings lists the declared ratings grouped by plugin, or says that no plugin adds any. A source the setting turns on that no enabled plugin declares, for example after its plugin was disabled, is listed separately so an administrator can turn it off before the plugin comes back.Silo-Server/silo-plugin-metadata-mdblist#4 updates the MDBList plugin to declare Rotten Tomatoes critics, Rotten Tomatoes audience and its own MDBList score. It stops sending Metacritic, Letterboxd, Trakt, Roger Ebert and MyAnimeList scores, whose terms restrict redistribution. Until that plugin update is installed, a server with this change shows only IMDb and TMDB.
Validation
rating_sourcesleaving out sources that are not shown and following the order ofratings;make lint-changedagainst the base branch reports no issues.go build,go vetandgofmtpass, as do theverify-*targets.verify-apiv2-contractreports only additive changes.make test-gopasses. After the review fixes, the Go tests forratingsources(also with-race),apiv2,metadata,models,catalogandapi, the admin settings and admin query vitest files,tsc,make lint-changedand theverify-apiv2-*,verify-local-pathsandverify-route-inventorytargets pass; the full suites were not rerun. Before them,make test-webfailed only inuseASSSubtitles.test.tsxanduseAudiobookPlayback.test.ts, which fail the same way onmainon the machine that ran the gate, and in oneCollectionTemplateGallery.test.tsxtest that timed out under full-suite load and passes on its own.Evidence: https://evidence.siloserver.org/r/silo-server/title-page-ratings/
Risks
rating_sources, the key and its rules are public.silo-plugin-sdk.Checklist
AI Disclosure
rating_sources,percentwith a scale other than 100, uncoalesced cache refreshes, a canceled request emptying the shared cache, unstable row order, turned-on sources hidden in the admin page, and two unused functions. One finding was not taken: it asked to offer only sources from plugins in some library's metadata chain. A declaration says how to show a source, and scores a plugin stored stay valid after it leaves a chain.Note
Let metadata plugins declare rating sources beyond IMDb and TMDB
RatingSourceDeclarerinterface or capabilityrating_sourcesmetadata; built-in sources are reduced to IMDb and TMDB, and the NFO provider declares the two Rotten Tomatoes sources.ratingsources.Policycaches plugin declarations (5s timeout, singleflight, last-good fallback) and gates display: a non-built-in source is shown only when declared by an enabled plugin and enabled by the administrator. Adds admin API endpointsGET /api/v2/admin/rating-sourcesand.../capabilities, plus a Ratings group in the admin Library & Metadata settings page.models.LookupRatingSourceandmodels.NormalizeRatingSourcewere removed. Stored rating rows for undeclared sources are hidden in catalog output (seeshownRatingSourcesin catalog_items.go). Percentage formatting inratingsources.Formatnow rounds the score directly instead of rescaling by the source scale.Macroscope summarized 7d397fa.