mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
TWK-949: Fixes multiple genres for Japan
This commit is contained in:
@@ -54,7 +54,7 @@ ChartsPlugin::ChartsPlugin()
|
|||||||
{
|
{
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << QThread::currentThread();
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << QThread::currentThread();
|
||||||
/// If you add resource, update version aswell
|
/// If you add resource, update version aswell
|
||||||
m_chartVersion = "2.4";
|
m_chartVersion = "2.5";
|
||||||
m_supportedGetTypes << InfoChart << InfoChartCapabilities;
|
m_supportedGetTypes << InfoChart << InfoChartCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,6 +333,7 @@ ChartsPlugin::chartsList()
|
|||||||
// WeAreHunted - Type - Artists - Chart Type
|
// WeAreHunted - Type - Artists - Chart Type
|
||||||
// - Tracks - Chart Type
|
// - Tracks - Chart Type
|
||||||
QHash< QString, QVariantMap > extraType;
|
QHash< QString, QVariantMap > extraType;
|
||||||
|
QStringList processed;
|
||||||
foreach( const QVariant& chartObj, res.values() )
|
foreach( const QVariant& chartObj, res.values() )
|
||||||
{
|
{
|
||||||
if( !chartObj.toMap().isEmpty() )
|
if( !chartObj.toMap().isEmpty() )
|
||||||
@@ -344,6 +345,17 @@ ChartsPlugin::chartsList()
|
|||||||
const QString type = QString( chart.value( "type" ).toString() + "s" );
|
const QString type = QString( chart.value( "type" ).toString() + "s" );
|
||||||
const bool isDefault = ( chart.contains( "default" ) && chart[ "default" ].toInt() == 1 );
|
const bool isDefault = ( chart.contains( "default" ) && chart[ "default" ].toInt() == 1 );
|
||||||
|
|
||||||
|
// Hack!
|
||||||
|
// Japan charts contains multiple duplicates, all which are linked
|
||||||
|
// back to ONE specific id. So we only parse the first
|
||||||
|
// Should/Could be fixed in the chartserver when its less fragile
|
||||||
|
if( geo == "jp" && type == "Tracks" )
|
||||||
|
{
|
||||||
|
if( processed.contains( name ) )
|
||||||
|
continue;
|
||||||
|
processed << name;
|
||||||
|
}
|
||||||
|
|
||||||
QString extra;
|
QString extra;
|
||||||
if( !geo.isEmpty() )
|
if( !geo.isEmpty() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user