mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
MusicBrainzPlugin: limit InfoArtistReleases to most popular artist only
This commit is contained in:
@@ -168,12 +168,15 @@ MusicBrainzPlugin::gotReleaseGroupsSlot()
|
|||||||
{
|
{
|
||||||
case InfoArtistReleases:
|
case InfoArtistReleases:
|
||||||
{
|
{
|
||||||
|
QString popularId = releaseGroupsNL.at(0).firstChildElement( "artist-credit" ).firstChildElement( "name-credit" ).firstChildElement( "artist" ).attribute( "id" );
|
||||||
|
|
||||||
QStringList albums;
|
QStringList albums;
|
||||||
for ( int i = 0; i < releaseGroupsNL.count(); i++ )
|
for ( int i = 0; i < releaseGroupsNL.count(); i++ )
|
||||||
{
|
{
|
||||||
QString groupTitle = releaseGroupsNL.at(i).firstChildElement("title").text();
|
QString groupTitle = releaseGroupsNL.at(i).firstChildElement("title").text();
|
||||||
QString a = releaseGroupsNL.at(i).firstChildElement( "artist-credit" ).firstChildElement( "name-credit" ).firstChildElement( "artist" ).firstChildElement( "name" ).text();
|
QString a = releaseGroupsNL.at(i).firstChildElement( "artist-credit" ).firstChildElement( "name-credit" ).firstChildElement( "artist" ).firstChildElement( "name" ).text();
|
||||||
if ( !albums.contains( groupTitle ) && hash["artist"] == a )
|
QString id = releaseGroupsNL.at(i).firstChildElement( "artist-credit" ).firstChildElement( "name-credit" ).firstChildElement( "artist" ).attribute( "id" );
|
||||||
|
if ( !albums.contains( groupTitle ) && hash["artist"] == a && id == popularId )
|
||||||
{
|
{
|
||||||
albums << groupTitle;
|
albums << groupTitle;
|
||||||
tDebug() << Q_FUNC_INFO << groupTitle;
|
tDebug() << Q_FUNC_INFO << groupTitle;
|
||||||
|
Reference in New Issue
Block a user