Repository navigation
Conversation
Jellyfin stores a country-coded certification as SE-7 or DE-16, while Normalize only understood the Kodi/Radarr colon form. The dash form folded to an unknown token, stored the unrecognized age and hid the title from every profile with a content-rating ceiling. Normalize now retries a string that did not resolve with a leading country code and dash removed. The whole string is tried first, and TV, PG and NC never count as countries, so dashed rungs such as TV-MA, PG-13 and NC-17 keep their meaning. The code must be a country, and the remainder is read only in that country's own ladder or as a bare age, so NZ-M does not borrow Australia's M. A remainder with letters the token folding would drop (HK-第3級) is refused rather than read as a bare age.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Contributor
Comment on lines
+285
to
+286
| if rest, systems, cut := cutDashedCountryPrefix(raw); cut { | ||
| return resolveRating(rest, systems, false) |
There was a problem hiding this comment.
Existing dashed ratings remain hidden by stale stored ages
Items rated SE-7 or DE-16 retain a stored age of 99, so maturity-filtered catalog queries still hide them despite the change to Normalize. Recompute affected ages during upgrade and refresh their episode catalog copies.
Prompt for LLM
File internal/access/rating.go, lines 285-286:
Existing dashed ratings remain hidden by stale stored ages
Existing `SE-7` and `DE-16` items retain the previously stored age of 99, so maturity-filtered catalog queries continue hiding them even though `Normalize` now recognizes their ratings. Recompute persisted ages for affected rows during upgrade and refresh their episode catalog copies.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
5 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #4495
Related issue: N/A
Validation tasks: none (kids filtering in #1180 C1 and #1181 C1 is reachable but not yet run)
Other clients: Apple N/A (no client-visible change); Android N/A (no client-visible change); Roku N/A (no client-visible change)
Silo understood a country code on a content rating only when a colon separated it:
SE:7resolved to age 7. Jellyfin writes the same rating asSE-7orDE-16, and those strings resolved to nothing. Silo stores an unreadable rating as age 99, so every profile with a content-rating ceiling lost these titles, whateveraccess.unrated_contentwas set to. A content_rating rule could not match them either. Anyone whose NFO files came from Jellyfin with a non-US certification country was affected.Approach
access.Normalizefirst tries the whole string as before. If that fails, it removes a leading country code and dash and resolves the rest. Trying the whole string first keepsTV-MA,PG-13,NC-17,MA-15+andUA-13+unchanged.The dash form is stricter than the colon form, because a string that used to be hidden must not start resolving to a younger age than it means:
countrySystems, or a regiongolang.org/x/text/languagetreats as a country.ZZ-7stays unrecognized.TV,PGandNCnever count as countries (Tuvalu, Papua New Guinea, New Caledonia), soPG-15stays unrecognized instead of becoming 15.NZ-M(16 in New Zealand) does not take Australia's M (15), andGB-AAdoes not take Mexico's all-ages AA.HK-第3級would become 3). Non-ASCII punctuation is fine, soFR-–16resolves to 16.Two things are left out on purpose:
SE-Btland localized text such asSE-Från 7 årstay unrecognized. The issue describes these as a missing capability, not a parsing defect.SE-7keeps age 99, which is the restrictive direction, until its metadata is refreshed or the file changes. A plain rescan of unchanged files does not rewrite the age.Validation
internal/accessfor the dash form, the dashed rungs it must keep, and the strings that must stay unrecognized. They failed before the fix.go build ./...,gofmt,go mod tidy -diff,go vet ./...,make lint-changed,make lint-router-recovery: clean.make test-go: passes.<mpaa>holds each value, checked before and after on the same database (below).Evidence
No screen changes, but the catalog changes which titles a restricted profile sees, so here are API results from a local build. A movie library holds synthetic titles with the NFO ratings shown. A second profile on the account has
max_content_ratingPG, then15.GET /api/v2/catalog?library_id=1was called with each profile'sX-Profile-ID, andcontent_rating_agewas read frommedia_items.Before, on
origin/mainat e8de111:After, on this branch, with the same database after a library metadata refresh (three more titles were added by a scan):
Risks
US-NRand similar now count as unrated rather than unreadable, the same asUS:NR, soaccess.unrated_contentdecides whether ceilinged profiles see them.Checklist
AI Disclosure
NZ-Mbecame 15,GB-AAbecame 0), any two letters counted as a country (ZZ-7, andDEU-16was missed), and two comments were stale. All three were fixed. Round two found two more: localized labels could fold to a bare age (HK-第3級), andUA-18andMA-16were refused needlessly. Both were fixed. Round three noted that the ASCII guard refusedFR-–16, so the guard now rejects only non-ASCII letters. Round four found that a full-width digit (DE-16) would fold to age 1, so the guard also rejects non-ASCII digits. Dismissed:AU-PGresolving to 8, which matches the existingAU:PGandPG;IE-12Astaying unrecognized because no Irish ladder exists yet, which fails in the restrictive direction; and inputs no tool writes, such asNR-17.Note
Resolve dashed country rating prefixes like SE-7 in access.Normalize
Normalizein rating.go now falls back to parsing dashed country prefixes (e.g.SE-7) when the full input does not resolve, using the country's own systems or a bare age.cutDashedCountryPrefixand a sharedcutCountryCodeparser; dashed prefixes that open rating rungs (viadashedRatingPrefixes) are excluded from country-code interpretation, as are remainders with non-ASCII alphanumerics that canonicalization would drop.resolveRatingTokengains acrossSystemflag so dashed-prefix lookups stay within the country's systems instead of crossing into another ladder.StoredRatingdocumentation.Macroscope summarized eb50d42.