Summary: | Smart Playlist Option - Sort by - Random - RATING weighted | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | HairMetalAddict <hairmetaladdict> |
Component: | Playlists/Saved Playlists | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
HairMetalAddict
2006-12-03 13:42:59 UTC
SVN commit 618179 by aoliveira: Rating weighted random order for smart playlists BUG: 138292 M +3 -1 playlistbrowseritem.cpp M +11 -1 smartplaylisteditor.cpp --- trunk/extragear/multimedia/amarok/src/playlistbrowseritem.cpp #618178:618179 @@ -3256,7 +3256,9 @@ { // shuffle if ( orderby.attribute("order" ) == "weighted" ) - qb.shuffle( QueryBuilder::tabStats, QueryBuilder::valForFavoriteSorting() ); + qb.shuffle( QueryBuilder::tabStats, QueryBuilder::valPercentage ); + else if ( orderby.attribute("order" ) == "ratingweighted" ) + qb.shuffle( QueryBuilder::tabStats, QueryBuilder::valRating ); else qb.shuffle(); } else { --- trunk/extragear/multimedia/amarok/src/smartplaylisteditor.cpp #618178:618179 @@ -127,6 +127,8 @@ updateOrderTypes( dbfield ); if ( orderby.attribute( "order" ) == "DESC" || orderby.attribute( "order" ) == "weighted" ) m_orderTypeCombo->setCurrentItem( 1 ); + else if ( orderby.attribute( "order" ) == "ratingweighted" ) + m_orderTypeCombo->setCurrentItem( 2 ); else m_orderTypeCombo->setCurrentItem( 0 ); } @@ -309,6 +311,7 @@ m_orderTypeCombo->clear(); m_orderTypeCombo->insertItem( i18n("Completely Random") ); m_orderTypeCombo->insertItem( i18n("Score Weighted") ); + m_orderTypeCombo->insertItem( i18n("Rating Weighted") ); } else { // ordinary order column selected m_orderTypeCombo->clear(); @@ -372,7 +375,14 @@ orderby.setAttribute( "order", m_orderTypeCombo->currentItem() == 1 ? "DESC" : "ASC" ); } else { orderby.setAttribute( "field", "random" ); - orderby.setAttribute( "order", m_orderTypeCombo->currentItem() == 1 ? "weighted" : "random" ); + QString order; + if ( m_orderTypeCombo->currentItem() == 0 ) + order = "random"; + else if ( m_orderTypeCombo->currentItem() == 1 ) + order = "weighted"; + else + order = "ratingweighted"; + orderby.setAttribute( "order", order ); } smartplaylist.appendChild( orderby ); Beautiful! Thanks a million. :-) |