mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
TWK-624: When resolving dups in dropjob, prefer playable ones
This commit is contained in:
@@ -701,10 +701,18 @@ DropJob::removeDuplicates()
|
|||||||
{
|
{
|
||||||
bool contains = false;
|
bool contains = false;
|
||||||
foreach( const Tomahawk::query_ptr &tmpItem, list )
|
foreach( const Tomahawk::query_ptr &tmpItem, list )
|
||||||
|
{
|
||||||
if ( item->album() == tmpItem->album()
|
if ( item->album() == tmpItem->album()
|
||||||
&& item->artist() == tmpItem->artist()
|
&& item->artist() == tmpItem->artist()
|
||||||
&& item->track() == tmpItem->track() )
|
&& item->track() == tmpItem->track() )
|
||||||
|
{
|
||||||
|
if ( item->playable() && !tmpItem->playable() )
|
||||||
|
list.replace( list.indexOf( tmpItem ), item );
|
||||||
|
|
||||||
contains = true;
|
contains = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( !contains )
|
if ( !contains )
|
||||||
list.append( item );
|
list.append( item );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user