fix(android): keep addon IMDb rating over TMDB vote average#1310
Open
DynamycSound wants to merge 1 commit into
Open
fix(android): keep addon IMDb rating over TMDB vote average#1310DynamycSound wants to merge 1 commit into
DynamycSound wants to merge 1 commit into
Conversation
The IMDb-labeled rating on the details screen was being overwritten with TMDB's vote_average during metadata enrichment, so the value shown under the IMDb logo was actually TMDB's rating. Prefer the addon-provided IMDb rating and only fall back to TMDB when the addon supplies none.
|
Nice work, thanks. Hope we can add this |
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.
Summary
The IMDb rating shown on the details screen was being replaced with TMDB's
vote_averageduring metadata enrichment. The value rendered under the IMDb logo/label was therefore TMDB's rating, not the IMDb rating. This change keeps the addon-provided IMDb rating and only falls back to TMDB when the addon supplies none.PR type
Why
In
TmdbMetadataService.applyEnrichment, theuseBasicInfobranch assigned:enrichment.ratingis sourced from TMDB'sdetails.voteAverage. Because TMDB's value took priority via?:, whenever TMDB enrichment was enabled (the default when a TMDB API key is configured) the real IMDb rating parsed from the meta addon (e.g. Cinemeta'simdbRating) was overwritten with TMDB'svote_average. The details screen (DetailMetaInfo) rendersmeta.imdbRatingunder the IMDb logo and yellow IMDb styling, so users saw a TMDB rating mislabeled as IMDb.Empirical check (TMDB v3 API vs Cinemeta) for The Dark Knight: Cinemeta
imdbRating=9.1, TMDBvote_average=8.531→ formatted8.5. The app displayed8.5under the IMDb label instead of9.1. TMDB'svote_averagediverges from the IMDb rating for the majority of titles, matching the report's "Often (more than 50%)".Issue or approval
Fixes #1271
UI / behavior impact
Old behavior: IMDb-labeled rating showed TMDB's
vote_averagewhenever TMDB enrichment was enabled.Broken behavior: the displayed IMDb rating was wrong for most titles.
New behavior: the addon-provided IMDb rating is shown; TMDB's rating is used only as a fallback when the addon provides no IMDb rating (e.g. the standalone TMDB-only path is unchanged). No layout, color, or label changes.
Policy check
Scope boundaries
composeApp/src/commonMain/kotlin/com/nuvio/app/features/tmdb/TmdbMetadataService.kt— inapplyEnrichment, theuseBasicInfobranch now prefersupdated.imdbRating(addon value) and falls back toenrichment.rating?.formatRating()(TMDB value) instead of the reverse. One line changed.composeApp/src/commonTest/kotlin/com/nuvio/app/features/tmdb/TmdbMetadataServiceTest.kt— two added unit tests.No other files touched. No formatting/rename changes.
Testing
./gradlew :composeApp:assembleFullDebug→ BUILD SUCCESSFUL../gradlew :composeApp:testFullDebugUnitTest --tests "com.nuvio.app.features.tmdb.TmdbMetadataServiceTest"→ BUILD SUCCESSFUL (all pass), including the two new tests:applyEnrichment keeps addon imdb rating instead of tmdb vote average— baseimdbRating = "9.1",enrichment.rating = 8.531; asserts result is"9.1"(fails before this change, which produced"8.5").applyEnrichment falls back to tmdb rating when addon has none— baseimdbRating = null,enrichment.rating = 8.531; asserts result is"8.5"(fallback path preserved).LibraryRepositoryTest,StreamAutoPlaySelectorTest); these fail identically on a cleancmp-rewritecheckout without this change and are pre-existing.applyEnrichment): used only byenrichMeta→MetaDetailsRepository.tryFetchMeta. The standalone TMDB-only path (buildStandaloneMeta) is intentionally left unchanged, so titles without an addon meta are unaffected.Screenshots / Video (UI changes only)
Not a UI change.
Breaking changes
None.
Linked issues
Fixes #1271