Bug 240293 - Amarok playlist filtering does not filter non-rated songs when "rating" is included in search preferences
Summary: Amarok playlist filtering does not filter non-rated songs when "rating" is in...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.3.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 2.3.2
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 01:07 UTC by Kevin Guertin
Modified: 2010-07-18 23:54 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 Kevin Guertin 2010-06-01 01:07:22 UTC
Version:           2.3.1 (using KDE 4.4.2) 
OS:                Linux

Playlist filtering does not work in any version of Amarok after 1.4 on my system in Ubuntu 9.04, 9.10, or 10.04.  

And yes, "Show only matches" is selected.

You can see this in action here:  http://www.youtube.com/watch?v=uKaugLMTcZ0

Some filtering happens, but leaves a ton of songs in my playlist that should have been filtered out.  I could type in any random characters by smashing my keyboard and still see songs in my playlist.

I'm inclined to think that this is unique to my setup since I cannot find anybody else online with this problem or just not searching with correct keywords.

My collection is over 20,000 songs.  The only thing I do after install is import my 1.4 statistics, which I will not give up.  All songs in the playlist are in the collection.  The collection filtering works.

Reproducible: Always

Steps to Reproduce:
I don't have to do anything.  It doesn't work by default.


Expected Results:  
It should only show me songs containing the text I type in.

OS: Linux (x86_64) release 2.6.32-22-generic
Compiler: cc
Comment 1 Myriam Schweingruber 2010-06-01 01:27:21 UTC
Please search for duplicates before submitting a report.

*** This bug has been marked as a duplicate of bug 193537 ***
Comment 2 Kevin Guertin 2010-06-01 01:40:04 UTC
This is NOT a duplicate of 193537.  Read the report and look at the linked video.
Comment 3 Kevin Guertin 2010-06-01 02:53:10 UTC
Wow... I think I finally found what's wrong after all these months...  

The playlist filtering breaks if you tell it to also search "Rating" in "Search Preferences".  It does not filter out non-rated songs when you have it selected.  All rated songs are filtered out.  

Still a bug.  I've updated the summary of this bug to reflect this.
Comment 4 Myriam Schweingruber 2010-06-01 11:58:10 UTC
Indeed, sorry for the confusion.
Comment 5 Myriam Schweingruber 2010-06-01 13:38:33 UTC
Confirmed.
Comment 6 FeepingCreature 2010-07-17 16:16:00 UTC
Just ran into this on 2.3.1.

The Ratings filter should be disabled until this is fixed.
Comment 7 Nikolaj Hald Nielsen 2010-07-18 13:40:08 UTC
This bug should be solved for 2.3.2 by the following commit:

commit 2d34e2593e97ce796fd17b193fcb8736b003d6b4
Author: Nikhil Marathe <nsm.nikhil@gmail.com>
Date:   Wed Jul 7 18:15:49 2010 +0530

   Ensure that the search term is numeric when searching by rating.

diff --git a/src/playlist/proxymodels/ProxyBase.cpp b/src/playlist/proxymodels/ProxyBase.cpp
index 314b7e0..b6ff53a 100644
--- a/src/playlist/proxymodels/ProxyBase.cpp
+++ b/src/playlist/proxymodels/ProxyBase.cpp
@@ -323,9 +323,13 @@ ProxyBase::rowMatch( int sourceModelRow, const QString &searchTerm, int searchFi
       )
        return true;

-    if( searchFields & MatchRating &&
-        track->rating() == QString( searchTerm ).remove( "rating:" ).toInt() )
-        return true;
+    if( searchFields & MatchRating )
+    {
+        bool ok;
+        int rating = QString( searchTerm ).remove( "rating:" ).toInt( &ok );
+        if( ok && ( track->rating() == rating ) )
+            return true;
+    }

    return false;
 }
Comment 8 Kevin Guertin 2010-07-18 23:54:19 UTC
Great news!  Can't wait to test it out.  :)  

Thanks!  :)