Bug: Custom filters do not properly handle "Track Rating" with tracks that have an empty rating

I just tried to make a custom filter that contains music by a particular artist that is not rated 1 star. So naturally I added two search criteria to the filter: “Artist Title is XYZ” and “Track Rating is not 1 Star”.

However, it excluded all music that had an empty rating. Furthermore, if I set the filter to include “Track Rating is not Empty” is still includes all music that has an empty rating.

I reported this as well. Between these and a few other reports, I think the “is not” operator isn’t working in general. It fails with filters other than rating.

It’s in our internal bug-tracker now, thanks for the report!

I see this bug has still not been resolved. I took the time to investigate the issue in hopes of getting it closed more promptly

Track filtering has a bug where tracks with empty ratings are not being properly filtered. For example if you apply a custom filter that says “Track Rating IS NOT 1 AND Track Rating IS NOT 2” all tracks with a rating of 5,4,3 AND empty should be included, but only tracks with a rating of 5,4 and 3 are returned

I am also pretty sure I can tell you why it happens. User track ratings in the Plex database are stored as a number between 1 and 10 for user star ratings with a value of 2 meaning the user rating is 1 star and NULL being stored meaning the track does not have a user rating. When sending the request “Track Rating IS NOT 1 AND Track Rating IS NOT 2” the SQL query that produced is something like:

SELECT tracks
FROM Rating 
WHERE rating <> 2
  AND rating <> 4

The problem with this is when the rating column is null the evaluate of “Null <>(not equal) 2” evaluates to false, not to true as expected. SQL treats Null as an unknown in comparison operations. So doing direct comparisons produces a false. The query your developers SHOULD build is something like:

SELECT tracks
FROM Rating 
WHERE ISNULL(rating, -1) != 2
  AND ISNULL(rating, -1) != 4

The is null function tells the query to treat null columns like -1, then all the not equal evaluations should work as expected.

I get this is a low priority bug that probably effects only a few users, but if you could take the time to fix it I would greatly appreciate it. Especially as there is no work around

3 Likes

Just hit this bug as well. Basically I wanted to create a smart playlist where all the songs I haven’t rated yet, or ones i rated as 3 starts or better would show up. This is my main “good music i want to listen on shuffle” playlist which I could then filter out low rated songs (like filler tracks that are great when listening to a whole album but terrible when they show up on random).

I think another solution would be to allow an “or” operator on rating fields. Then everyone can be happy as I can create a playlist that’s all good songs and empty ratings while someone else who has rated all of their music might not want empty ratings in their list.

2 Likes

If anyone is trying to run a similar setup to me (having a playlist of “good” songs to shuffle) I found a bit of a workaround although it’s not ideal.

If you go to your music library and create a custom filter of “rating is empty” you can see all the songs that haven’t been rated yet. Then you can select bunches of them and mass edit them to have a 3 star rating. I say bunches of them because your browser literally melts if you try to select too many at once and edit them all. I found doing 200-300 at a time worked best, probably depends on your CPU. Kind of annoying with a 13,000 song library, but chipping away at it a few minutes here and there while working on other things made it more bearable.

Of course this means you have to remember to do this to every album you add as your collection grows. This is the downside of not being able to just make a “has rating >= 3 or isn’t rated yet” filter. But it’s not so bad since you can just check this “unrated” filter every few weeks or after adding a bunch of albums. Now you can listen to your collection on shuffle and either rate up good songs (for your “Top Rated” playlist) or rate songs down that you only want to listen to when you’re listening to a full album.

Thanks Rory. Having the same issue. Just want listen to all of my music on shuffle except the songs I tag as 1 star.

The “Is Not” 1 star should work but it excludes everything with empty.

1 Like

Just found this, and am bumping it because no one from Plex has ever commented. I’m seeing the same bug. The results from filtering on ‘is not’ 1 star should include all the empties.

There have been other posts on this, all closed. Is this recognized as a bug?

1 Like

The third post in the thread is from one of Plex’s co-founders.

My mistake. When first opening the thread, it started me at the June 2018 posting. I didn’t see the earlier exchanges.

So that makes it a two year old bug. Any hope?

They don’t discuss their roadmap, generally. There are plenty of older bugs, so who knows?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.