fix(details): keep addon IMDb rating instead of TMDB score

When a metadata addon (e.g. aiometadata) supplies a genuine IMDb rating,
the TMDB enrichment on the details page was overwriting it with TMDB's
vote_average because the copy() preferred enrichment.rating over the
existing value. This made the IMDb placeholder display the TMDB score on
mobile, even though the addon provided IMDb ratings (the TV version was
already correct).

Invert the precedence so the addon-provided imdbRating is kept and TMDB's
vote_average is only used as a fallback when no rating was supplied.

Fixes #1377
This commit is contained in:
VenusIsJaded 2026-06-22 11:13:40 +00:00 committed by VenusIsJaded
parent 50a923d056
commit fca06204e0

View file

@ -647,7 +647,8 @@ object TmdbMetadataService {
updated = updated.copy(
name = enrichment.localizedTitle ?: updated.name,
description = enrichment.description ?: updated.description,
imdbRating = enrichment.rating?.formatRating() ?: updated.imdbRating,
imdbRating = updated.imdbRating?.takeIf { it.isNotBlank() }
?: enrichment.rating?.formatRating(),
genres = enrichment.genres.ifEmpty { updated.genres },
)
}