1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-26 07:14:47 +02:00

* Query::equals() can now ignore album names.

This commit is contained in:
Christian Muehlhaeuser
2014-08-19 13:45:07 +02:00
parent 8af8de9f4b
commit 03d774b9e7
2 changed files with 4 additions and 4 deletions

View File

@@ -490,18 +490,18 @@ Query::checkResults()
bool
Query::equals( const Tomahawk::query_ptr& other, bool ignoreCase ) const
Query::equals( const Tomahawk::query_ptr& other, bool ignoreCase, bool ignoreAlbum ) const
{
if ( other.isNull() )
return false;
if ( ignoreCase )
return ( queryTrack()->artist().toLower() == other->queryTrack()->artist().toLower() &&
queryTrack()->album().toLower() == other->queryTrack()->album().toLower() &&
( ignoreAlbum || queryTrack()->album().toLower() == other->queryTrack()->album().toLower() ) &&
queryTrack()->track().toLower() == other->queryTrack()->track().toLower() );
else
return ( queryTrack()->artist() == other->queryTrack()->artist() &&
queryTrack()->album() == other->queryTrack()->album() &&
( ignoreAlbum || queryTrack()->album() == other->queryTrack()->album() ) &&
queryTrack()->track() == other->queryTrack()->track() );
}

View File

@@ -51,7 +51,7 @@ public:
virtual ~Query();
bool equals( const Tomahawk::query_ptr& other, bool ignoreCase = false ) const;
bool equals( const Tomahawk::query_ptr& other, bool ignoreCase = false, bool ignoreAlbum = false ) const;
float howSimilar( const Tomahawk::result_ptr& r );
QVariant toVariant() const;