feat(ratings): show every rating source the server already sent
Plezy rendered exactly one score per item. MediaRatingBadge._ratingDataFor took `rating` and fell back to `audienceRating` only when it was null, so a Plex movie carrying four attributed scores surfaced one, and which one was whatever the server happened to put in the scalar slot. #1755 asked for a setting to choose the source; showing all of them answers it without one. The data was already on the wire and being thrown away. `/library/metadata/ {id}` returns a `Rating[]` child array — IMDb, both Rotten Tomatoes panels, TMDB — with no extra query parameter, but PlexMetadataDto declared no field for it, so json_serializable dropped the key. The identical parse already existed in plex_catalog_source for the Explore tab and had simply never been wired to library items. Model the scores as a list rather than widening the scalar pair. The neutral MediaItem gains `ratings`; PlexMediaItem loses audienceRating, ratingImage and audienceRatingImage, which the list subsumes — Plex sends those images on listings too, so the same field covers both response shapes and no caller narrows to a backend type to read a score any more. CatalogRatingSource is promoted to lib/media as MediaRatingSource instead of growing a second near-identical type beside it, and plex_catalog_source's _ratingsFor becomes the shared plexRatingSources so one implementation serves both paths. There is no persistence to migrate: MediaItem.toJson has no production caller, the offline path re-parses raw Plex JSON through the same mapper, and Plex's audienceRating sort is server-supplied data, not a model read. Cards and the dashboard still show fewer scores than detail screens, and that part is a real Plex limit rather than a shortcut. Section listings send only the scalar pair; includeRatings, includeElements=Rating, includeFields=Rating, includeChildren and includeExtras were each probed against a live server and none surfaced the array, while includeGuids=1 demonstrably does add Guid[] — the probe works, the parameter does not exist. Hydrating every card would be one request per row, so listings render whatever their own response carried, which is one or two attributed scores rather than the single one they showed before. Jellyfin has no per-source array at all: the server collapses whatever its fetchers found into CommunityRating and CriticRating. CommunityRating's provenance is unknowable from the DTO — TMDB vote_average, IMDb via OMDb or a local NFO, last writer wins — so it stays the generic `audience` source with no brand mark. CriticRating is the Rotten Tomatoes Tomatometer as a 0-100 percent and is divided by ten explicitly rather than folded by magnitude, because a Tomatometer of 9 means 9% and range-sniffing would have promoted a rotten score to fresh. Photo rows are skipped, since Jellyfin reuses CommunityRating for the EXIF 0-5 star. The badges share one slot on every surface. On the phone hero the scores go in a single pill because that chip row is a height-clipped Wrap and a chip per source would push year, certification and runtime out of the visible band on short heroes; on the TV detail line and the dashboard spotlight the group occupies the one metadata slot so bullet separators do not multiply. The group announces itself as a single semantics node naming each source, because a bare row of four percentages tells a screen reader nothing about which score is which. rating_utils drops parseRatingImage and isRottenTomatoes — the URI vocabulary now lives only in the Plex mapper — and the source-key resolver and label map, previously private to the Explore detail screen, become the shared pair both screens use. The label strings move from explore.ratingSource to common.ratingSource accordingly, which costs no translations because every non-English value was empty; running clean_translations also scaffolds startup.quitPlezy and startup.restartRequiredBody, which were already drifted. Verified against the live server the probes came from: a detail response now yields TMDB 83%, IMDb 8.3 and Rotten Tomatoes audience 96% through the production mapper and badge resolver, and the listing response for the same title yields TMDB 83% alone. Both payloads are pinned verbatim as fixtures. Coverage adds mapper ordering, dedupe against the array's repeat of the scalar, out-of-range rejection, the Jellyfin scale and photo guard, the CatalogItem conversion that feeds Explore's dashboard hubs, and the three render surfaces including the semantics announcement. close #1755
This commit is contained in:
+90
-90
@@ -300,6 +300,8 @@ class Translations$common$en {
|
||||
|
||||
/// en: 'Press back again to exit'
|
||||
String get pressBackAgainToExit => 'Press back again to exit';
|
||||
|
||||
late final Translations$common$ratingSource$en ratingSource = Translations$common$ratingSource$en.internal(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -3040,7 +3042,7 @@ class Translations$explore$en {
|
||||
late final Translations$explore$format$en format = Translations$explore$format$en.internal(_root);
|
||||
late final Translations$explore$sourceMaterial$en sourceMaterial = Translations$explore$sourceMaterial$en.internal(_root);
|
||||
late final Translations$explore$creditRole$en creditRole = Translations$explore$creditRole$en.internal(_root);
|
||||
late final Translations$explore$ratingSource$en ratingSource = Translations$explore$ratingSource$en.internal(_root);
|
||||
late final Translations$explore$relation$en relation = Translations$explore$relation$en.internal(_root);
|
||||
|
||||
/// en: 'Airs ${day} at ${time}'
|
||||
String broadcast({required Object day, required Object time}) => 'Airs ${day} at ${time}';
|
||||
@@ -3055,8 +3057,6 @@ class Translations$explore$en {
|
||||
one: '${n} result',
|
||||
other: '${n} results',
|
||||
);
|
||||
|
||||
late final Translations$explore$relation$en relation = Translations$explore$relation$en.internal(_root);
|
||||
}
|
||||
|
||||
// Path: liveTv
|
||||
@@ -4820,6 +4820,48 @@ class Translations$addServer$en {
|
||||
String get borrowFromAnotherProfileSubtitle => 'Reuse another profile\'s connection. PIN-protected profiles require a PIN.';
|
||||
}
|
||||
|
||||
// Path: common.ratingSource
|
||||
class Translations$common$ratingSource$en {
|
||||
Translations$common$ratingSource$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Critics'
|
||||
String get critic => 'Critics';
|
||||
|
||||
/// en: 'Audience'
|
||||
String get audience => 'Audience';
|
||||
|
||||
/// en: 'IMDb'
|
||||
String get imdb => 'IMDb';
|
||||
|
||||
/// en: 'TMDB'
|
||||
String get tmdb => 'TMDB';
|
||||
|
||||
/// en: 'Rotten Tomatoes'
|
||||
String get rottenTomatoes => 'Rotten Tomatoes';
|
||||
|
||||
/// en: 'Simkl'
|
||||
String get simkl => 'Simkl';
|
||||
|
||||
/// en: 'MyAnimeList'
|
||||
String get mal => 'MyAnimeList';
|
||||
|
||||
/// en: 'AniList'
|
||||
String get anilist => 'AniList';
|
||||
|
||||
/// en: 'Trakt'
|
||||
String get trakt => 'Trakt';
|
||||
|
||||
/// en: 'Rotten Tomatoes critics'
|
||||
String get rottenTomatoesCritic => 'Rotten Tomatoes critics';
|
||||
|
||||
/// en: 'Rotten Tomatoes audience'
|
||||
String get rottenTomatoesAudience => 'Rotten Tomatoes audience';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class Translations$hotkeys$actions$en {
|
||||
Translations$hotkeys$actions$en.internal(this._root);
|
||||
@@ -5414,46 +5456,40 @@ class Translations$explore$creditRole$en {
|
||||
String get composer => 'Composer';
|
||||
}
|
||||
|
||||
// Path: explore.ratingSource
|
||||
class Translations$explore$ratingSource$en {
|
||||
Translations$explore$ratingSource$en.internal(this._root);
|
||||
// Path: explore.relation
|
||||
class Translations$explore$relation$en {
|
||||
Translations$explore$relation$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Critics'
|
||||
String get critic => 'Critics';
|
||||
/// en: 'Prequel'
|
||||
String get prequel => 'Prequel';
|
||||
|
||||
/// en: 'Audience'
|
||||
String get audience => 'Audience';
|
||||
/// en: 'Sequel'
|
||||
String get sequel => 'Sequel';
|
||||
|
||||
/// en: 'IMDb'
|
||||
String get imdb => 'IMDb';
|
||||
/// en: 'Side story'
|
||||
String get sideStory => 'Side story';
|
||||
|
||||
/// en: 'TMDB'
|
||||
String get tmdb => 'TMDB';
|
||||
/// en: 'Spin-off'
|
||||
String get spinOff => 'Spin-off';
|
||||
|
||||
/// en: 'Rotten Tomatoes'
|
||||
String get rottenTomatoes => 'Rotten Tomatoes';
|
||||
/// en: 'Alternative version'
|
||||
String get alternativeVersion => 'Alternative version';
|
||||
|
||||
/// en: 'Simkl'
|
||||
String get simkl => 'Simkl';
|
||||
/// en: 'Summary'
|
||||
String get summary => 'Summary';
|
||||
|
||||
/// en: 'MyAnimeList'
|
||||
String get mal => 'MyAnimeList';
|
||||
/// en: 'Parent story'
|
||||
String get parentStory => 'Parent story';
|
||||
|
||||
/// en: 'AniList'
|
||||
String get anilist => 'AniList';
|
||||
/// en: 'Adaptation'
|
||||
String get adaptation => 'Adaptation';
|
||||
|
||||
/// en: 'Trakt'
|
||||
String get trakt => 'Trakt';
|
||||
|
||||
/// en: 'Rotten Tomatoes critics'
|
||||
String get rottenTomatoesCritic => 'Rotten Tomatoes critics';
|
||||
|
||||
/// en: 'Rotten Tomatoes audience'
|
||||
String get rottenTomatoesAudience => 'Rotten Tomatoes audience';
|
||||
/// en: 'Related'
|
||||
String get other => 'Related';
|
||||
}
|
||||
|
||||
// Path: explore.detail
|
||||
@@ -5555,42 +5591,6 @@ class Translations$explore$detail$en {
|
||||
String get background => 'Background';
|
||||
}
|
||||
|
||||
// Path: explore.relation
|
||||
class Translations$explore$relation$en {
|
||||
Translations$explore$relation$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Prequel'
|
||||
String get prequel => 'Prequel';
|
||||
|
||||
/// en: 'Sequel'
|
||||
String get sequel => 'Sequel';
|
||||
|
||||
/// en: 'Side story'
|
||||
String get sideStory => 'Side story';
|
||||
|
||||
/// en: 'Spin-off'
|
||||
String get spinOff => 'Spin-off';
|
||||
|
||||
/// en: 'Alternative version'
|
||||
String get alternativeVersion => 'Alternative version';
|
||||
|
||||
/// en: 'Summary'
|
||||
String get summary => 'Summary';
|
||||
|
||||
/// en: 'Parent story'
|
||||
String get parentStory => 'Parent story';
|
||||
|
||||
/// en: 'Adaptation'
|
||||
String get adaptation => 'Adaptation';
|
||||
|
||||
/// en: 'Related'
|
||||
String get other => 'Related';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class Translations$downloads$backgroundWarning$en {
|
||||
Translations$downloads$backgroundWarning$en.internal(this._root);
|
||||
@@ -6083,6 +6083,17 @@ extension on Translations {
|
||||
'common.fullscreen' => 'Fullscreen',
|
||||
'common.exitFullscreen' => 'Exit fullscreen',
|
||||
'common.pressBackAgainToExit' => 'Press back again to exit',
|
||||
'common.ratingSource.critic' => 'Critics',
|
||||
'common.ratingSource.audience' => 'Audience',
|
||||
'common.ratingSource.imdb' => 'IMDb',
|
||||
'common.ratingSource.tmdb' => 'TMDB',
|
||||
'common.ratingSource.rottenTomatoes' => 'Rotten Tomatoes',
|
||||
'common.ratingSource.simkl' => 'Simkl',
|
||||
'common.ratingSource.mal' => 'MyAnimeList',
|
||||
'common.ratingSource.anilist' => 'AniList',
|
||||
'common.ratingSource.trakt' => 'Trakt',
|
||||
'common.ratingSource.rottenTomatoesCritic' => 'Rotten Tomatoes critics',
|
||||
'common.ratingSource.rottenTomatoesAudience' => 'Rotten Tomatoes audience',
|
||||
'screens.licenses' => 'Licenses',
|
||||
'screens.switchProfile' => 'Switch Profile',
|
||||
'screens.subtitleStyling' => 'Subtitle Styling',
|
||||
@@ -6523,6 +6534,8 @@ extension on Translations {
|
||||
'rateSheet.notAvailable' => 'No match found',
|
||||
'rateSheet.noConnectedServices' => 'Connect a service in Settings to rate there.',
|
||||
'accessibility.mediaCardMovie' => ({required Object title}) => '${title}, movie',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'accessibility.mediaCardShow' => ({required Object title}) => '${title}, TV show',
|
||||
'accessibility.mediaCardEpisode' => ({required Object title, required Object episodeInfo}) => '${title}, ${episodeInfo}',
|
||||
'accessibility.mediaCardSeason' => ({required Object title, required Object seasonInfo}) => '${title}, ${seasonInfo}',
|
||||
@@ -6534,8 +6547,6 @@ extension on Translations {
|
||||
'accessibility.increase' => 'Increase',
|
||||
'accessibility.decreaseValue' => ({required Object label}) => 'Decrease ${label}',
|
||||
'accessibility.increaseValue' => ({required Object label}) => 'Increase ${label}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'accessibility.hue' => 'Hue',
|
||||
'accessibility.saturation' => 'Saturation',
|
||||
'accessibility.brightness' => 'Brightness',
|
||||
@@ -7037,6 +7048,8 @@ extension on Translations {
|
||||
'explore.season.fall' => 'Fall',
|
||||
'explore.season.withYear' => ({required Object season, required Object year}) => '${season} ${year}',
|
||||
'explore.format.tv' => 'TV',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.format.tvShort' => 'TV Short',
|
||||
'explore.format.movie' => 'Movie',
|
||||
'explore.format.special' => 'Special',
|
||||
@@ -7048,8 +7061,6 @@ extension on Translations {
|
||||
'explore.sourceMaterial.manga' => 'Manga',
|
||||
'explore.sourceMaterial.lightNovel' => 'Light novel',
|
||||
'explore.sourceMaterial.novel' => 'Novel',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.sourceMaterial.visualNovel' => 'Visual novel',
|
||||
'explore.sourceMaterial.game' => 'Game',
|
||||
'explore.sourceMaterial.webComic' => 'Web comic',
|
||||
@@ -7060,17 +7071,15 @@ extension on Translations {
|
||||
'explore.creditRole.producer' => 'Producer',
|
||||
'explore.creditRole.creator' => 'Creator',
|
||||
'explore.creditRole.composer' => 'Composer',
|
||||
'explore.ratingSource.critic' => 'Critics',
|
||||
'explore.ratingSource.audience' => 'Audience',
|
||||
'explore.ratingSource.imdb' => 'IMDb',
|
||||
'explore.ratingSource.tmdb' => 'TMDB',
|
||||
'explore.ratingSource.rottenTomatoes' => 'Rotten Tomatoes',
|
||||
'explore.ratingSource.simkl' => 'Simkl',
|
||||
'explore.ratingSource.mal' => 'MyAnimeList',
|
||||
'explore.ratingSource.anilist' => 'AniList',
|
||||
'explore.ratingSource.trakt' => 'Trakt',
|
||||
'explore.ratingSource.rottenTomatoesCritic' => 'Rotten Tomatoes critics',
|
||||
'explore.ratingSource.rottenTomatoesAudience' => 'Rotten Tomatoes audience',
|
||||
'explore.relation.prequel' => 'Prequel',
|
||||
'explore.relation.sequel' => 'Sequel',
|
||||
'explore.relation.sideStory' => 'Side story',
|
||||
'explore.relation.spinOff' => 'Spin-off',
|
||||
'explore.relation.alternativeVersion' => 'Alternative version',
|
||||
'explore.relation.summary' => 'Summary',
|
||||
'explore.relation.parentStory' => 'Parent story',
|
||||
'explore.relation.adaptation' => 'Adaptation',
|
||||
'explore.relation.other' => 'Related',
|
||||
'explore.broadcast' => ({required Object day, required Object time}) => 'Airs ${day} at ${time}',
|
||||
'explore.broadcastWithZone' => ({required Object day, required Object time, required Object timezone}) => 'Airs ${day} at ${time} ${timezone}',
|
||||
'explore.detail.originalTitle' => 'Original title',
|
||||
@@ -7103,15 +7112,6 @@ extension on Translations {
|
||||
'explore.detail.relatedTitles' => 'Related titles',
|
||||
'explore.detail.background' => 'Background',
|
||||
'explore.totalResults' => ({required num n}) => (_root.$meta.cardinalResolver ?? PluralResolvers.cardinal('en'))(n, one: '${n} result', other: '${n} results', ),
|
||||
'explore.relation.prequel' => 'Prequel',
|
||||
'explore.relation.sequel' => 'Sequel',
|
||||
'explore.relation.sideStory' => 'Side story',
|
||||
'explore.relation.spinOff' => 'Spin-off',
|
||||
'explore.relation.alternativeVersion' => 'Alternative version',
|
||||
'explore.relation.summary' => 'Summary',
|
||||
'explore.relation.parentStory' => 'Parent story',
|
||||
'explore.relation.adaptation' => 'Adaptation',
|
||||
'explore.relation.other' => 'Related',
|
||||
'liveTv.title' => 'Live TV',
|
||||
'liveTv.guide' => 'Guide',
|
||||
'liveTv.noChannels' => 'No channels available',
|
||||
|
||||
Reference in New Issue
Block a user