Skip to content

feat(ratings): let metadata plugins declare every rating beyond IMDb and TMDB - #1698

Merged
Quick104 merged 34 commits into
mainfrom
feat/plugin-rating-sources
Oct 1, 2026
Merged

Quick104 merged 34 commits into
mainfrom
feat/plugin-rating-sources

Conversation

@Quick104

@Quick104 Quick104 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

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 .nfo files.

Approach

  • Declaring a rating. A metadata plugin lists its ratings under rating_sources in its capability's manifest metadata:

    • id: the source name;
    • name: the plain-text mark next to the score, such as RT;
    • 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_critic and rt_audience name 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 in docs/catalog-api.md.

  • Storing scores. The host keeps a plugin's ratings.sources entry only for imdb, tmdb and 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's rating_sources member now lists only the sources title pages show, in the same order as ratings. 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/ratingsources reads 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. getRatingsCapability from 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 its name.

  • Admin list. GET /api/v2/admin/rating-sources lists IMDb, TMDB and every declared rating, crediting every provider that declares it, such as "NFO Files and MDBList". GET /api/v2/admin/rating-sources/capabilities reports plugin_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

  • Unit tests cover:
    • manifest parsing: valid entries, labels, each rule that drops an entry, duplicates, the per-capability cap, and a malformed entry next to valid ones;
    • ingest keeping declared names and dropping undeclared ones;
    • a turned-on source that no plugin declares, Rotten Tomatoes included, staying hidden;
    • the policy keeping the last declarations read when a later read fails, retrying when the first read fails, and ignoring a canceled request context;
    • rating_sources leaving out sources that are not shown and following the order of ratings;
    • a percent declaration showing the 0-100 score whatever its scale;
    • the admin list containing only IMDb, TMDB and declared ratings, and the capability document's shape and admin-only access;
    • the admin page grouping ratings by plugin, listing turned-on sources that no plugin declares, and hiding the group on a server without the capability.
  • make lint-changed against the base branch reports no issues. go build, go vet and gofmt pass, as do the verify-* targets. verify-apiv2-contract reports only additive changes. make test-go passes. After the review fixes, the Go tests for ratingsources (also with -race), apiv2, metadata, models, catalog and api, the admin settings and admin query vitest files, tsc, make lint-changed and the verify-apiv2-*, verify-local-paths and verify-route-inventory targets pass; the full suites were not rerun. Before them, make test-web failed only in useASSSubtitles.test.tsx and useAudiobookPlayback.test.ts, which fail the same way on main on the machine that ran the gate, and in one CollectionTemplateGallery.test.tsx test that timed out under full-suite load and passes on its own.
  • On a Silo dev deployment running this branch, with the MDBList 0.5.0 plugin from feat: declare Rotten Tomatoes and MDBList score as rating sources silo-plugin-metadata-mdblist#4 installed and seeded scores:
    • the admin Ratings group listed Rotten Tomatoes critics and audience "From NFO Files and MDBList", and the MDBList score "From MDBList", with no Metacritic, Letterboxd or Trakt switch;
    • title pages showed IMDb and TMDB by default;
    • after turning the three on, a movie with all five ratings plus a stored Metacritic score showed the first three, IMDb, TMDB and RT, at desktop and phone width; Metacritic never showed;
    • the Ratings group says a title page shows at most three ratings, in order;
    • the browser console showed no errors.

Evidence: https://evidence.siloserver.org/r/silo-server/title-page-ratings/

Risks

  • Rotten Tomatoes disappears until the plugin update. A server running this change with the current MDBList plugin shows no Rotten Tomatoes scores, even if an administrator turned them on.
  • New plugin contract. Once plugins rely on rating_sources, the key and its rules are public.
  • No SDK support yet. The SDK has no typed helper or documentation for the key; that is a follow-up in silo-plugin-sdk.
  • Migrations. None.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: T3 Code (Claude Code agent harness)
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code review pass (claude-opus-5-5) read the first version of this change and feat(ratings): show the same external ratings on every title page #1697. It found two low-severity issues here: a failed read of plugin declarations could discard the administrator's setting, and one malformed manifest entry dropped every declared source of that capability. Both are fixed and covered by tests. A second Claude Code review pass (claude-opus-5-5) read this pull request after the change to plugin-only sources. The fixes for its findings are in the latest commit: stored scores of undeclared sources in rating_sources, percent with 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

  • Metadata plugins can now declare rating sources (name, label, scale, percentage semantics) via a RatingSourceDeclarer interface or capability rating_sources metadata; built-in sources are reduced to IMDb and TMDB, and the NFO provider declares the two Rotten Tomatoes sources.
  • ratingsources.Policy caches 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 endpoints GET /api/v2/admin/rating-sources and .../capabilities, plus a Ratings group in the admin Library & Metadata settings page.
  • Catalog item rating-source output now follows the selection's display order and drops stored sources not declared by an enabled plugin.
  • Behavioral Change: previously built-in third-party sources (Trakt, Metacritic, Letterboxd, etc.) in rating_sources.go no longer display unless a plugin declares them; models.LookupRatingSource and models.NormalizeRatingSource were removed. Stored rating rows for undeclared sources are hidden in catalog output (see shownRatingSources in catalog_items.go). Percentage formatting in ratingsources.Format now rounds the score directly instead of rescaling by the source scale.

Macroscope summarized 7d397fa.

Quick104 and others added 2 commits September 29, 2026 17:34
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]>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7aeaa86a-3810-4ba1-935a-c2cf6920c84c

📥 Commits

Reviewing files that changed from the base of the PR and between 84f23ab and 7d397fa.

📒 Files selected for processing (49)
  • contracts/api/v2/fixtures/admin_rating_source_capabilities.json
  • contracts/api/v2/fixtures/admin_rating_sources.json
  • contracts/api/v2/fixtures/get_ratings_capability_authentication_required.json
  • contracts/api/v2/fixtures/get_system_info_ok.json
  • contracts/api/v2/fixtures/index.json
  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • docs/catalog-api.md
  • docs/settings-api.md
  • internal/api/handlers/admin_stats_top.go
  • internal/api/handlers/admin_stats_top_test.go
  • internal/api/router.go
  • internal/api/testdata/media_routes.txt
  • internal/apiv2/admin_dashboard_insights.go
  • internal/apiv2/admin_rating_sources.go
  • internal/apiv2/admin_rating_sources_fixtures_test.go
  • internal/apiv2/catalog_items.go
  • internal/apiv2/catalog_items_test.go
  • internal/apiv2/catalog_ratings_test.go
  • internal/apiv2/document.go
  • internal/apiv2/document_test.go
  • internal/apiv2/fixtures_test.go
  • internal/apiv2/ratings_capability.go
  • internal/catalog/detail_batch_equivalence_test.go
  • internal/catalog/rating_source_repo_db_test.go
  • internal/config/admin_settings.go
  • internal/metadata/builtin.go
  • internal/metadata/builtin_rating_sources_test.go
  • internal/metadata/chain.go
  • internal/metadata/nfo/provider.go
  • internal/metadata/nfo/rating_sources_test.go
  • internal/metadata/plugin_provider.go
  • internal/metadata/rating_sources_db_test.go
  • internal/metadata/rating_sources_declared_test.go
  • internal/metadata/rating_sources_test.go
  • internal/metadata/service.go
  • internal/models/rating_sources.go
  • internal/ratingsources/ratingsources.go
  • internal/ratingsources/ratingsources_test.go
  • web/src/api/v2/operations.ts
  • web/src/api/v2/schema.ts
  • web/src/hooks/queries/admin/plugins.ts
  • web/src/hooks/queries/admin/ratingSources.ts
  • web/src/hooks/queries/keys.ts
  • web/src/hooks/queries/ratingsSurfaceRefresh.ts
  • web/src/pages/admin-settings/LibraryMetadataSettings.test.tsx
  • web/src/pages/admin-settings/LibraryMetadataSettings.tsx
  • web/src/pages/admin-settings/ratingSources.test.ts
  • web/src/pages/admin-settings/ratingSources.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Quick104 and others added 4 commits September 29, 2026 19:40
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]>
@Quick104 Quick104 changed the title feat(metadata): let metadata plugins declare rating sources of their own feat(ratings): let metadata plugins declare every rating beyond IMDb and TMDB Sep 30, 2026
@Quick104
Quick104 marked this pull request as ready for review September 30, 2026 00:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T17:21:50.546784Z 7d397fa New commits
ℹ️ 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" or "@codex security review".

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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/apiv2/admin_rating_sources.go Resolved
Comment thread internal/metadata/chain.go Resolved
Quick104 and others added 4 commits September 29, 2026 21:12
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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/metadata/chain.go Resolved
…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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Quick104 and others added 5 commits September 29, 2026 21:31
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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Quick104 and others added 3 commits September 29, 2026 22:44
…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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/ratingsources/ratingsources.go Resolved
Quick104 and others added 4 commits September 29, 2026 22:55
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
Quick104 and others added 7 commits September 30, 2026 00:05
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]>
# Conflicts:
#	contracts/api/v2/fixtures/get_system_info_ok.json
# Conflicts:
#	contracts/api/v2/fixtures/get_system_info_ok.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/metadata/plugin_provider.go Resolved
…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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/metadata/chain.go Resolved
…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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Quick104
Quick104 changed the base branch from feat/title-page-ratings to main October 1, 2026 16:34
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]>
@kody-ai

kody-ai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@Quick104
Quick104 merged commit 96b03a0 into main Oct 1, 2026
3 of 10 checks passed
@Quick104
Quick104 deleted the feat/plugin-rating-sources branch October 1, 2026 17:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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')`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Quick104 added a commit that referenced this pull request Oct 8, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant