Bug 172112 - don't use 0 to denote unrated and unscored tracks
Summary: don't use 0 to denote unrated and unscored tracks
Status: CONFIRMED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.3-GIT
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 174593 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-03 22:40 UTC by Caleb Cushing
Modified: 2010-05-23 07:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Cushing 2008-10-03 22:40:05 UTC
Version:           pre 2.0 beta (using Devel)
OS:                Linux
Installed from:    Compiled sources

0 is used to denote a unrated tracks. NULL should be used as null is not less than a rating of 5. this causes serious problems when creating playlists that basically asking for values greater than anything.
Comment 1 Seb Ruiz 2008-10-04 00:46:16 UTC
I don't understand what you are saying. Can you please provide an example?
Comment 2 Caleb Cushing 2008-10-04 20:19:56 UTC
when tracks are added to the database their rating is 0 it should be NULL.

if I tell amarok to not play tracks rated less than 2 it won't play anything I haven't rated either. because the database sees 0 as less than 2.

even though not rated is the same as saying we don't have a rating or don't have any information on a rating. null is the proper value for when you don't have information on something.

this problem has been present for several years.
Comment 3 Seb Ruiz 2008-11-08 12:57:58 UTC
*** Bug 174593 has been marked as a duplicate of this bug. ***
Comment 4 Karthik Periagaram 2009-03-29 01:09:43 UTC
This is because "rating" and score are variables (integer between 0-10, and float between 0-100 respectively) internally. Unrated songs do actually have a rating of 0 and the lowest rating you can assign to a song is 1 (0.5 stars).

The other option is perhaps have amarok assign an initial rating of 5 (2.5 stars) to all songs, which might not be such a good idea...For now, you could exclude songs between 0.5 and 2 stars and that will work...
Comment 5 Caleb Cushing 2009-03-29 01:16:00 UTC
that wouldn't work as the query would still see it as less than. you're proposing a 'hack' and not in a good way, the fix is to use nulls.
Comment 6 Stephen Baker 2009-12-02 04:18:29 UTC
A 'null' wouldn't have any relationship with > or < some number of stars.  If we take the SQL meaning it would always be false and never be selected by any star selection.

Semantics asside it might be nice to list unrated tracks as unrated, and have an option on dynamic playlists to include unrated tracks.
Comment 7 Stephen Baker 2009-12-02 04:20:20 UTC
To clarify my last remark, I mean to allow a selection like 5 star and unrated tracks; which is, I think, a reasonable use case.
Comment 8 Myriam Schweingruber 2009-12-02 09:41:31 UTC
You are welcome to give a hand :) Source code is on Gitorious: http://gitorious.org/amarok
Comment 9 Stephen Baker 2009-12-02 19:34:19 UTC
I haven't worked much with kdelibs/qt and I'm pretty swamped with work, but I'll take a look sometime between now and Sunday.