Skip to content

fix: normalize Letterboxd ratings to 0-5 scale in MdbListController#138

Merged
RadicalMuffinMan merged 2 commits into
Moonfin-Client:masterfrom
mattsigal:feature/letterboxd-rating-fix
Jun 8, 2026
Merged

fix: normalize Letterboxd ratings to 0-5 scale in MdbListController#138
RadicalMuffinMan merged 2 commits into
Moonfin-Client:masterfrom
mattsigal:feature/letterboxd-rating-fix

Conversation

@mattsigal

@mattsigal mattsigal commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes Letterboxd ratings displaying as doubled values in all clients.

MDBList's value field for Letterboxd is on an ambiguous 0-10 scale
(doubled from the native 0-5 scale). The previous client-side value > 5
halving guard failed silently for any film scoring 2.5/5 or below ? those
values after doubling are ? 5 and are indistinguishable from a real low-end
score, so they passed through un-halved and displayed incorrectly. Since
clients receive value directly from this API, no client can reliably self-correct.

The fix normalizes in FilterAndOrderRatings() using score / 20, where
score is MDBList's unambiguous 0?100 field, before the data is returned.
All clients receive a correct 0?5 value without needing their own workarounds.

Type of Change

  • Bug fix

Changes Made

  • MdbListController.cs: Added a Letterboxd-specific normalization step
    in FilterAndOrderRatings(). When a Letterboxd rating is about to be
    returned, Value is replaced with Score / 20.0. The raw MDBList data
    in the cache is left untouched; normalization happens on the way out only.

Testing

Verified on physical device (NVIDIA Shield Pro) via the Moonfin Android TV
beta client. Letterboxd badges now display as X.X/5 with correct values
across the full rating range, including films scoring below 2.5/5.

  • Confirmed Sorry to Bother You shows 3.7/5 (was 7.4)
  • Confirmed The Descent: Part 2 shows 2.4/5 (matches Letterboxd.com)

Screenshots

Current build:
Shield_Screenshot_2026-05-31_22-14-45

Fixed:
Shield_Screenshot_2026-05-31_22-11-49

Low Score (undeserved!):
Shield_Screenshot_2026-05-31_22-29-34

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Build Successful

The plugin compiled successfully against .NET 8 / Jellyfin 10.10.0.

Property Value
Commit c7869cc
Workflow Build #92

@mattsigal mattsigal force-pushed the feature/letterboxd-rating-fix branch from 2881b2a to b4189f1 Compare June 1, 2026 05:55
MDBList's value field for Letterboxd is on an ambiguous 0-10 scale
(doubled from the native 0-5 scale). Any film scoring 2.5/5 or below
produces a value <= 5 after doubling, indistinguishable from a real
low-end score, so clients cannot reliably correct it themselves.

Fix: normalize in FilterAndOrderRatings() using score / 20 (where score
is MDBList's unambiguous 0-100 field) before the data is returned to any
client. This fixes the display for all clients without requiring
client-side workarounds.
@mattsigal mattsigal force-pushed the feature/letterboxd-rating-fix branch from b4189f1 to 76cb8a7 Compare June 1, 2026 14:54
@mattsigal

Copy link
Copy Markdown
Contributor Author

Updated the logic to handle the string formatting at the plugin level.

if (ratingsBySource.TryGetValue(source, out var rating))
{
result.Add(rating);
// Clone the rating object to prevent mutating the cached instance in memory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is overcomplicated. just replace
result.Add(rating);

with

if (string.Equals(rating.Source, "letterboxd", StringComparison.OrdinalIgnoreCase)
    && rating.Value.HasValue
    && rating.Value.Value > 5)
{
    rating.Value /= 2;
}

result.Add(rating);

Comment thread backend/Api/MdbListController.cs
Comment thread backend/Api/MdbListController.cs Outdated
@RadicalMuffinMan RadicalMuffinMan merged commit 6cf64d8 into Moonfin-Client:master Jun 8, 2026
1 check passed
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.

2 participants