Bug 136052 - "Favourite Tracks" Ignores Rating
Summary: "Favourite Tracks" Ignores Rating
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 21:04 UTC by Jonathan Anderson
Modified: 2006-12-05 12:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot with Rating System (497.28 KB, image/png)
2006-10-20 21:06 UTC, Jonathan Anderson
Details
Screenshot with Scoring System (491.03 KB, image/png)
2006-10-20 21:10 UTC, Jonathan Anderson
Details
Patch for amarok/src/contextbrowser.cpp (1.19 KB, patch)
2006-10-25 13:48 UTC, Jonathan Anderson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Anderson 2006-10-20 21:04:10 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages

I love Amarok's new manual rating system. Thank you, thank you, *thank you* for giving me the choice: automatic scoring is a great idea, but it gets messed up by things like shuffle mode and other people listening to my music.

My problem is: the "Favourite Tracks by $artist" list puts the tracks in auto-score order. I have song with a rating of 5 stars that goes below songs with 2.5 stars because I was jumping around my playlist (I think the logic is "if he skipped the song, he must not like it").

So, if I'm using the rating system instead of auto-scoring, I think that my Favourite Tracks ought to be ordered by rating.
Comment 1 Jonathan Anderson 2006-10-20 21:06:14 UTC
Created attachment 18209 [details]
Screenshot with Rating System

A screenshot of the problem. Notice that there is a 5-star song listed below a
2.5-star song.
Comment 2 Jonathan Anderson 2006-10-20 21:10:36 UTC
Created attachment 18210 [details]
Screenshot with Scoring System

This is a screenshot with the scored turned on. Notice that:

1. Scores have been calculated, even though I don't use them (this is fine,
maybe over the long term they'll become accurate and I'll start using them)

2. The order of the Favourite Tracks (which is the same in both screenshots) is
determined by score.
Comment 3 Martin Aumueller 2006-10-23 19:20:24 UTC
This seems to be already fixed for 1.4.4.

*** This bug has been marked as a duplicate of 134893 ***
Comment 4 Jonathan Anderson 2006-10-23 19:53:47 UTC
So it does... sorry for the dupe. I did search for similar bugs, I just didn't see 134893.
Comment 5 Jonathan Anderson 2006-10-23 20:53:07 UTC
Hang on a second... this *isn't* a duplicate.

I tried applying the patch in #134893, and it fixes the smart playlists, but I'm talking about the list "Favourite Tracks by $artist" in the Context pane/tab/whatever. They're still ordered by score, not rating.

There is similar code in contextbrowser.cpp... I'm checking to see if I can get this working.
Comment 6 Jonathan Anderson 2006-10-25 13:48:57 UTC
Created attachment 18259 [details]
Patch for amarok/src/contextbrowser.cpp

This patch should fix everything... it's based on the patch that closed bug
#134893, but this is in contextbrowser.cpp instead of playlistbrowser.cpp.
Comment 7 Alexandre Oliveira 2006-10-25 23:11:03 UTC
SVN commit 599121 by aoliveira:

Favorite tracks would respect score/rating options as it should.
Patch by Jonathan Anderson <jonathan.anderson@ieee.org>
BUG: 136052


 M  +7 -4      contextbrowser.cpp  


--- trunk/extragear/multimedia/amarok/src/contextbrowser.cpp #599120:599121
@@ -2275,6 +2275,12 @@
     QueryBuilder qb;
     QStringList values;
 
+    int favSortBy = QueryBuilder::valPercentage;
+    if ( !AmarokConfig::useScores() && !AmarokConfig::useRatings() )
+        favSortBy = QueryBuilder::valPlayCounter;
+    else if( !AmarokConfig::useScores() )
+        favSortBy = QueryBuilder::valRating;
+
     qb.clear();
     qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle );
     qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
@@ -2282,10 +2288,7 @@
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
     qb.excludeFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "1", QueryBuilder::modeLess );
     qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) );
-    if( AmarokConfig::useScores() )
-        qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valScore, true );
-    if( AmarokConfig::useRatings() )
-        qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valRating, true );
+    qb.sortBy( QueryBuilder::tabStats, favSortBy, true );
     qb.setLimit( 0, 10 );
     values = qb.run();
     usleep( 10000 );
Comment 8 simon 2006-10-30 22:35:35 UTC
Still not exactly what he and i want - i think it should be the other way round. If i have a rating this should be prefered over score, because i always set it actively and therefore it should be more accurate.

so it would be (old style):
@@ -2195,6 +2195,7 @@
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore );
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
     qb.addMatches( QueryBuilder::tabArtist, relArtists );
+    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valRating, true );
     qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valScore, true );
     qb.setLimit( 0, 10 );
     values = qb.run();
@@ -2274,7 +2275,9 @@
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
     qb.excludeFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "1", QueryBuilder::modeLess );
     qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) );
-    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valForFavoriteSorting(), true );
+   // qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valForFavoriteSorting(), true );
+    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valRating, true );
+    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valScore, true );
     qb.setLimit( 0, 10 );
     values = qb.run();
     usleep( 10000 );


or with the valForFavoriteSorting():
--- original/collectiondb.cpp	2006-10-30 21:16:01.000000000 +0100
+++ patched2/collectiondb.cpp	2006-10-30 22:33:15.000000000 +0100
@@ -7573,12 +7573,12 @@
 
 
 Q_INT64
-QueryBuilder::valForFavoriteSorting() {
-    Q_INT64 favSortBy = valPercentage;
+QueryBuilder::valForFavoriteSorting() {    
+    Q_INT64 favSortBy = valRating;
     if ( !AmarokConfig::useScores() && !AmarokConfig::useRatings() )
         favSortBy = valPlayCounter;
-    else if( !AmarokConfig::useScores() )
-        favSortBy = valRating;
+    else if( !AmarokConfig::useRatings() )
+        favSortBy = valPercentage;
     return favSortBy;
 }
 
diff -aur original/contextbrowser.cpp patched2/contextbrowser.cpp
--- original/contextbrowser.cpp	2006-10-30 21:16:01.000000000 +0100
+++ patched2/contextbrowser.cpp	2006-10-30 22:33:21.000000000 +0100
@@ -2195,6 +2195,7 @@
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore );
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
     qb.addMatches( QueryBuilder::tabArtist, relArtists );
+    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valRating, true );
     qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valScore, true );
     qb.setLimit( 0, 10 );
     values = qb.run();
Comment 9 Seb Ruiz 2006-10-31 03:39:40 UTC
I agree, user defined ratings should have a preference over calculated scores

On 30 Oct 2006 21:35:35 -0000, simon <s7mon@web.de> wrote:
[bugs.kde.org quoted mail]
Comment 10 simon 2006-10-31 08:47:51 UTC
I just saw that my last  example is not perfect when using valForFavoriteSorting().
Because in this case sorting  is only done by rating, but it would be better to use both like in:
sortBy(..valRating) and sortBy(..valScore).
Comment 11 simon 2006-11-07 15:01:12 UTC
Just checked out svn today - while both scores and rating are used now i think the order in showSuggestedSongs is still wrong.
The two lines:
    qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore );
    qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
should be switched. That would make more sense for me.

--- original/contextbrowser.cpp 2006-11-07 12:59:06.000000000 +0100
+++ patched/contextbrowser.cpp  2006-11-07 14:58:32.000000000 +0100
@@ -2190,9 +2190,9 @@
     qb.clear();
     qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
     qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle );
-    qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName );
-    qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore );
+    qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName );
     qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating );
+    qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore );
     qb.addMatches( QueryBuilder::tabArtist, relArtists );
     qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valScore, true );
     qb.setLimit( 0, 10 );

Comment 12 Alexandre Oliveira 2006-11-07 17:55:17 UTC
simon, the order of that commands don't make any difference for sorting. 
Comment 13 simon 2006-11-07 18:55:58 UTC
Yes your're right i mixed it up with the sortBy which i suggested in my previous post - sorry for the confusion.  
so there should be a extra 
    qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valRating, true );
in showSuggestedSongs or the 
    qb.sortByFavorite();
as in showArtistsFaves.
Comment 14 Brendon Higgins 2006-11-26 01:20:15 UTC
Hi. Question: Does this also address similar problems in the Statistics tab of the Track Information window? (Still at 1.4.1 here, so forgive me if that's already done.)
Comment 15 Seb Ruiz 2006-11-26 05:59:31 UTC
yes

On 26 Nov 2006 00:20:17 -0000, Brendon Higgins <blhiggins@gmail.com> wrote:
[bugs.kde.org quoted mail]
Comment 16 simon 2006-12-05 12:51:48 UTC
Just wanted to ask if someone could bring this into svn soon?
I mean the sort for suggested songs?