Bug 139002 - search in collection browser returns inaccurate results
Summary: search in collection browser returns inaccurate results
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: 1.4-SVN
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 10:08 UTC by Ljubomir
Modified: 2006-12-20 13:59 UTC (History)
0 users

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 Ljubomir 2006-12-19 10:08:28 UTC
Version:           1.4-SVN (using KDE 3.5.4, Kubuntu Package 4:3.5.4-0ubuntu2~dapper1 )
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-27-k7

Entering any search term in "Search" field of Collection browser, returns only one track: "Fill Me" by Acid Drinkers. This track is not the first one in collection, nor is the only track by Acid Drinkers. Before entering any search term, my full collection is shown in the browser. I have done full rescan of collection, but it doesn't seem to affect bug. 
I'm using revision 614862.

This problem occurred as soon as bug 138913 has been fixed.
Comment 1 highelf 2006-12-19 10:54:39 UTC
Same here, except I get alway the 3 same results no matters what I search.
Comment 2 Sven Krohlas 2006-12-19 11:14:29 UTC
Same here, always the same results. And all contain the per cent sign %.
Comment 3 Maximilian Kossick 2006-12-19 11:37:57 UTC
the search is broken using a sqlite database, but works with MySql. There are no sql errors im Amarok's debug output.
Comment 4 Alexandre Oliveira 2006-12-19 11:42:27 UTC
I broke something in the like function, then.
Comment 5 Alexandre Oliveira 2006-12-20 01:04:13 UTC
SVN commit 615053 by aoliveira:

Oops...
Fix the search problems with sqlite.
BUG: 139002


 M  +3 -2      collectiondb.cpp  


--- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #615052:615053
@@ -6241,9 +6241,10 @@
 
     int begin = pattern.startsWith( "%" ), end = pattern.endsWith( "%" );
     if (begin)
-        pattern = pattern.right( 1 );
+        pattern = pattern.right( pattern.length() - 1 );
     if (end)
-        pattern = pattern.left( pattern.length() - 2 );
+        pattern = pattern.left( pattern.length() - 1 );
+
     if( argc == 3 ) // The function is given an escape character. In likeCondition() it defaults to '/'
         pattern.replace( "/%", "%" ).replace( "/_", "_" ).replace( "//", "/" );
 
Comment 6 Ljubomir 2006-12-20 13:59:21 UTC
Yeah, fixed. Thx!