Bug 129395

Summary: there are recommand songs twice or more often
Product: [Applications] amarok Reporter: Haeber <thomas>
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.4.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A Screenshot a amaroK 1.4 where a recommanded song listed twice

Description Haeber 2006-06-19 02:18:57 UTC
Version:           1.4.0 (using KDE 3.5.3 Level "a" , unofficial build of SUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.13-4-default

The list with recommanded songs sometimes contains songs twice or more often. This is useless. See the screenshot.
Comment 1 Haeber 2006-06-19 02:21:04 UTC
Created attachment 16690 [details]
A Screenshot a amaroK 1.4 where a recommanded song listed twice
Comment 2 Maximilian Kossick 2006-11-05 13:20:31 UTC
SVN commit 602114 by mkossick:

don't show songs with score 0 multiple times if there are less than 10 suggested songs
BUG: 129395

 M  +0 -25     contextbrowser.cpp  


--- trunk/extragear/multimedia/amarok/src/contextbrowser.cpp #602113:602114
@@ -2198,31 +2198,6 @@
     qb.setLimit( 0, 10 );
     values = qb.run();
 
-    // not enough items returned, let's fill the list with score-less tracks
-    if ( values.count() < 10 * qb.countReturnValues()
-         && !CollectionDB::instance()->getDbConnectionType() == DbConnection::mysql )
-    {
-        qb.clear();
-        qb.exclusiveFilter( QueryBuilder::tabSong, QueryBuilder::tabStats, QueryBuilder::valURL );
-        qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL );
-        qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle );
-        qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName );
-        qb.addMatches( QueryBuilder::tabArtist, relArtists );
-        qb.setOptions( QueryBuilder::optRandomize );
-        qb.setLimit( 0, 10 - values.count() / 5 ); // previous query had 5 return values, so count()/5 is the number of rows
-
-        QStringList sl;
-        sl = qb.run();
-        for ( uint i = 0; i < sl.count(); i += qb.countReturnValues() )
-        {
-            values << sl[i];
-            values << sl[i + 1];
-            values << sl[i + 2];
-            values << "0";
-            values << "0";
-        }
-    }
-
     // <Suggested Songs>
     if ( !values.isEmpty() )
     {