Kodi Community Forum

Full Version: Smart playlists return empty because of rating rules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hardware: Raspberry Pi 3 and PC
OS: LibreElec 8.0.1 and Windows 10

I tried this with updated and all fresh Krypton installations on Rpi3 and Windows in turns, scanned HDD folders with music files to Kodi library, created a smart playlist with criteria 'rating:3' & 'greater than', 'limit to 10', 'order:random', just like I used to do on Jarvis and it would then return a list of music just as expected. Opened the newly created smart playlist in Krypton, but the playlist returns plain empty. Everything else in the music library seems to work ok, like they did in Jarvis, manual .m3u's, automated top100s and party playlists work without problems, it's just the smart playlists that fail and return empty.

Can't live without smart playlists, for me they have been the biggest improvement in music listening at home since the introduction of compressed audio files at adequate quality on computers. Nod

Fixes, workarounds, anybody else with this problem? Google didn't recognize this topic, making me wonder if anybody else uses Kodi music library smart playlists, but me.

Until the smart playlists work, I'll keep with Jarvis. Another issue for me is the new Estuary skin and the fact that it's messy to navigate and doesn't support all Kodi features to my experience. Tested Estuary once, saw it had several flaws and misses, went straight to Confluence and will stick to that if I'm ever to return to Krypton or anything that follows - but that's a topic for another thread anyway.
Kodi now supports 2 different ratings fields for songs - rating and userrating. For consistency with video maybe? I have no idea why other team members made this change.

Anyway I suspect you just need to change your playlist rules to use the userrating field instead of rating, that is where the migrated data went. It is now a score out of 10. For more "consistency" it is called "my rating" on screen.

For example:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
    <rule field="userrating" operator="greaterthan">

Search for "rating" should find more discussion. Also might help others if you change the title (edit the 1st post) to mention rating too - it is not a general playlist issue, but a specific one.

My family is also sticking with Confluence. But if you want to moan about Estuary then do so in a skins subforum not here. It will do no good there either, but at least it theory it is the area sknners could look at.
Thanks DaveBlake! I never really noticed that it was particularly rating for criteria that broke the smart playlists, rating being such important criteria for me defining a list in the first place, having spent hours and hours rating my songs to sort out the ones that deserves to get listened the most.

Opened Krypton Kodi and saw that My Rating was just next to the plain Rating. Being so relieved, but at the same time confused that they should change such detail for user's nuisance, wish there would have been even a script to ask for auto correction of older smart playlists referring to the old rating entry after an update installation. How hard would have that been? Maybe too hard. Otherwise the new list to select the criteria didn't seem that bad idea.

I'll be happily back with LibreElec 8.0.1 Kodi Krypton as of today, whew! Also happy to hear that there are also other "Confluence warriors", besides me. Thanks again, bless you!
The changes to rating were well intended I'm sure, but they have caused some issues. I've fixed some of these, but don't have any justification for the change. The dev team is small, all volunteers woking for free, so there are many possible things that we just don't have the resources to do, even easy things.

Unfortunately users are left to sort out the playlists manually I'm afraid.
There is IMO a problem with how userrating is initialized on newly scanned media that results in smart playlists failing to to find unrated songs (the stored value is null, not 0 as required by the rule). I wrote a PR to fix, but wanted to test it first before submitting it. Unfortunately my attempts so far to build Kodi locally have failed and I just don't have time ATM to sort out.

scott s.
I'm never seeing nulls Scott, for either rating or userrating in album or song tables, but that is with a clean db. Scraping can set value to -1 or -1.0, is that the smart playlist issue you have encountered? Or if you have got nulls can you work out what you did e.g. database migration from earlier version, import or something.

PRs welcome Smile
What dev env do you have? Perhaps I can help with the build issue? Be good to get more people able to build and thus contribute code changes. But I understand the time problem too.
My bad -- the problem is videodb userrating, music is correct.

I set up VS 2015 on Win 7 to build Kodi with, and haven't had time to debug why the scripts failed. Going to be away from my dev environment for a bit, so will tackle it at a later time. Part of my problem might be that I have been using github desktop app on windows to manage my github repos, but I'm thinking the scripts need me to do some set up of Git Bash (I have it installed but don't use it normally).

scott s.
Hello everyone,

I read caerfully this thread as I have quite similar problems with Krypton...
I have filled the rating with "mediamonkey" which has only 5 stars at the most

1/I have a smart playlist with criteria = 'userrating' & 'greater than' & '4', as i realised there are songs with rating = 3 which are played in this playlist ! how can that be ?
2/I would have planned to only have songs with rating > 4 (ie. 4.5 and 5) - and no songs with rating = 4 as it's "greater than" and not "greater than or equal" - but maybe it doesn't work like I think ?
3/I didn't quite understand : is it possible to choose "rating is 10" Huh or maybe is it only for movies ?

thank you very much the forum in advance for your help !

1/there are songs with rating =3.5 so far...

The scale in Kodi is integers 0 - 10 while MM has "half stars" 0 - 5 so "3 stars" in MM = userrating 6 in Kodi.  ' userrating' & 'greater than' & '4' means 2-1/2 or more MM "my rating" stars.

scott s.