Ratings for applications don't work (it just lists the ratings from Plasma widgets). This is using the Packagekit backend and the ubuntu repository appstream data. bug 343084 is a problem in the qapt backend but I guess that's separate code from Packagekit Reproducible: Always
some appstream data is generated by aleix at http://appstream.kubuntu.co.uk/ (converted from popcon) so the question is how to wire that up to neon's appstream data
Here it's explained a bit, you can see how it's generated a bit in the readme. Is there neon popcon? https://github.com/aleixpol/AppstreamPopcon By the way, I can't connect to that server anymore. :/
FWIW, this should work on neon too, it will just show data from Debian/Ubuntu. Likewise, when Discover is shown nowadays, it shows the popcon data from these distros.
Looking at the code I see it hardcodes the URL and that is downloaded into /home/jr/.cache/muondiscover/appstream-popcon.gz fine however it looks like Discover isn't picking up those ratings as all apps have zero stars showing. How can we debug why it's not picking up those ratings?
Maybe you can check whether it's being loaded. FWIW I tested Neon and it works for me. Another thing you can check is whether the downloaded file is valid. diff --git a/libdiscover/backends/PackageKitBackend/AppstreamReviews.cpp b/libdiscover/backends/PackageKitBackend/AppstreamReviews.cpp index 2f5bd02..8d2552c 100644 --- a/libdiscover/backends/PackageKitBackend/AppstreamReviews.cpp +++ b/libdiscover/backends/PackageKitBackend/AppstreamReviews.cpp @@ -64,6 +64,7 @@ void AppstreamReviews::ratingsFetched(KJob* job) void AppstreamReviews::readRatings() { + qDebug() << "reading ratings..." << ratingsCache->toLocalFile(); QScopedPointer<QIODevice> dev(new KCompressionDevice(ratingsCache->toLocalFile(), KCompressionDevice::GZip)); if (!dev->open(QIODevice::ReadOnly)) { qWarning() << "couldn't open popcon file" << dev->errorString();
Added that and compiled it and on running it does output reading ratings... "/home/jr/.cache/muondiscover/appstream-popcon.gz" but the ratings box doesn't show any apps and searching for e.g. konsole shows it has 0 stars
Adding some more debugging it does seem to successfully read the popcon file In PopConParser.cpp QHash<QString, Rating *> PopConParser::parsePopcon(QObject* parent, QIODevice* dev) Added: qDebug() << "XXXadding ratings" << pkgName << " " << vote; I can see: XXXadding ratings "org.kde.konsole.desktop" 503916 But in AppstreamReviews.cpp Rating * AppstreamReviews::ratingForApplication(AbstractResource* app) const I re-enable the debug line qDebug() << "fuuuuuu" << appk->appstreamId() << m_ratings.value(appk->appstreamId()); and add qDebug() << " " << m_ratings.value(appk->appstreamId())->rating(); it show: fuuuuuu "org.kde.konsole.desktop" Rating(0x5a90120) "org.kde.konsole.desktop" 0 so something is wiping the ratings and it shows
the key apol@oliver is in authorized_keys for ssh ubuntu@appstream.kubuntu.co.uk, does that work?
Yes it does, sorry, I forgot the ubuntu@. I'll investigate more, thanks for checking.
At the moment we are not serving the rating property, because we don't actually have data for the rating. We're just filling the ratingCount, which is the number of installations provided by popcon. We need to find a way to have ratings.
Ah hah, can we hide the Ratings box on the front page until that gets implemented?
Git commit 88c09c19d4260494d4626ca85a9575529d697dfb by Aleix Pol. Committed on 02/06/2016 at 14:13. Pushed by apol into branch 'master'. Don't show the stars if there's a null rating M +2 -3 discover/qml/Rating.qml http://commits.kde.org/discover/88c09c19d4260494d4626ca85a9575529d697dfb