Bug 513139

Summary: Average rating is incorrect
Product: [Applications] Discover Reporter: Thomas Bertels <tbertels>
Component: discoverAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: agurenko, akselmo, aleixpol, f.alexander.wilms, nate
Priority: HI    
Version First Reported In: 6.5.3   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.6.1
Sentry Crash Report:
Attachments: Quick PDF Join
Sejda PDF Desktop

Description Thomas Bertels 2025-12-09 20:45:58 UTC
Created attachment 187469 [details]
Quick PDF Join

SUMMARY
The average rating seems to be computed incorrectly.

OBSERVED RESULT
Quick PDF Join: 4 ratings of 5 stars each -> average of 4.0
Sejda PDF Desktop: 4 ratings of between 1 and 3 stars -> average of 3.9

EXPECTED RESULT
Quick PDF Join: average of 5.0
Sejda PDF Desktop: average of 3.0 or less

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Comment 1 Thomas Bertels 2025-12-09 20:46:22 UTC
Created attachment 187470 [details]
Sejda PDF Desktop
Comment 2 Nate Graham 2025-12-10 16:39:36 UTC
Can reproduce.
Comment 3 Nate Graham 2025-12-18 22:52:38 UTC
The issue here is that the bars for each star rating aren't reflective of all the reviews, only some of them. Need to look into why we don't get all of them.
Comment 4 Alexander Wilms 2026-01-11 15:07:45 UTC
The star ratings use application.rating.sortableRating, the ODRS rating that includes all reviews, including filtered ones with Wilson Score dampening applied.

The review distribution bars only show the reviews that were actually fetched and pass the shouldShow filter:

const bool shouldShow = usefulFavorable >= usefulNegative * 2 && review.value(QLatin1StringView("reported")).toInt() < 4;

https://invent.kde.org/plasma/discover/-/blob/ba9e95005a2256d2b993b51645484191a2c6c76b/libdiscover/appstream/OdrsReviewsJob.cpp#L132
Comment 5 Bug Janitor Service 2026-01-15 11:12:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/1232
Comment 6 Akseli Lahtinen 2026-02-10 12:28:10 UTC
Git commit 9ec8683c094acced024a3e1b71be2814f674fda3 by Akseli Lahtinen.
Committed on 10/02/2026 at 12:28.
Pushed by akselmo into branch 'master'.

ReviewStats, Rating: Expose starCounts from rating and use it for ReviewStats

ReviewStats was calculating the rating progressBars from
reviews only, not from all the total reviews. This
was confusing, since the actual rating value was calculated
from the total ratings.

This exposes the star counts in Rating class and changes
ReviewStats to utilize that instead, so we get accurate
progressbars per rating.

Also changes the sorting button name of "Rating" to "Popularity"

M  +1    -1    discover/qml/ApplicationDelegate.qml
M  +1    -1    discover/qml/ApplicationPage.qml
M  +1    -1    discover/qml/ApplicationsListPage.qml
M  +5    -5    discover/qml/ReviewsStats.qml
M  +7    -1    libdiscover/ReviewsBackend/Rating.cpp
M  +11   -0    libdiscover/ReviewsBackend/Rating.h
M  +0    -67   libdiscover/ReviewsBackend/ReviewsModel.cpp
M  +0    -29   libdiscover/ReviewsBackend/ReviewsModel.h

https://invent.kde.org/plasma/discover/-/commit/9ec8683c094acced024a3e1b71be2814f674fda3