Bug 129395 - there are recommand songs twice or more often
Summary: there are recommand songs twice or more often
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.4.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-19 02:18 UTC by Haeber
Modified: 2006-11-05 13:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
A Screenshot a amaroK 1.4 where a recommanded song listed twice (130.67 KB, image/png)
2006-06-19 02:21 UTC, Haeber
Details

Note You need to log in before you can comment on or make changes to this bug.
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() )
     {