Summary: | Smart Playlist: 2 genres breaks Expand by Year | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | HairMetalAddict <hairmetaladdict> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.3.2 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
HairMetalAddict
2005-09-22 09:37:53 UTC
SVN commit 463103 by aoliveira: On Smart Playlists, "Expand by" wouldn't work well together with a set of "Match Any" conditions. BUG: 113044 M +8 -4 smartplaylisteditor.cpp --- trunk/extragear/multimedia/amarok/src/smartplaylisteditor.cpp #463102:463103 @@ -306,12 +306,13 @@ QString joins = "tags INNER JOIN year ON year.id=tags.year INNER JOIN genre ON genre.id=tags.genre" " INNER JOIN artist ON artist.id=tags.artist INNER JOIN album ON album.id=tags.album"; QString whereStr; + QString criteriaListStr; QString orderStr; QString limitStr; //where expression if( m_matchCheck->isChecked() ) { - whereStr += " WHERE ("; + criteriaListStr += " ("; CriteriaEditor *criteria = m_criteriaEditorList.first(); for( int i=0; criteria; criteria = m_criteriaEditorList.next(), i++ ) { @@ -331,8 +332,9 @@ str.prepend( " " + op + " ("); } - whereStr += str+")"; + criteriaListStr += str+")"; } + whereStr = " WHERE" + criteriaListStr; } //order by expression @@ -384,8 +386,10 @@ if( !joins.contains( table ) ) { joins += " INNER JOIN statistics ON statistics.url=tags.url"; } - whereStr = QString("%1 AND %1 = \"(*ExpandString*)\"").arg(whereStr).arg(field); - + if ( !criteriaListStr.isEmpty() ) + whereStr = QString(" WHERE (%1) AND %2 = \"(*ExpandString*)\"").arg(criteriaListStr).arg(field); + else + whereStr = QString("WHERE %1 = \"(*ExpandString*)\"").arg(field); m_expandQuery = "SELECT album.name, artist.name, genre.name, tags.title, year.name, " "tags.comment, tags.track, tags.bitrate, tags.length, tags.samplerate, tags.url" " FROM " + joins + whereStr + orderStr + limitStr + ";"; |