mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Only cache last.fm similar artists/tracks if there is data
This commit is contained in:
@@ -596,11 +596,14 @@ LastFmInfoPlugin::similarArtistsReturned()
|
|||||||
|
|
||||||
emit info( requestData, returnedData );
|
emit info( requestData, returnedData );
|
||||||
|
|
||||||
|
if ( !sortedArtists.isEmpty() )
|
||||||
|
{
|
||||||
Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>();
|
Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>();
|
||||||
Tomahawk::InfoSystem::InfoStringHash criteria;
|
Tomahawk::InfoSystem::InfoStringHash criteria;
|
||||||
criteria["artist"] = origData["artist"];
|
criteria["artist"] = origData["artist"];
|
||||||
emit updateCache( criteria, 2419200000, requestData.type, returnedData );
|
emit updateCache( criteria, 2419200000, requestData.type, returnedData );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -638,16 +641,21 @@ LastFmInfoPlugin::similarTracksReturned()
|
|||||||
returnedData["artists"] = sortedArtists;
|
returnedData["artists"] = sortedArtists;
|
||||||
returnedData["score"] = sortedScores;
|
returnedData["score"] = sortedScores;
|
||||||
|
|
||||||
|
qDebug() << "Returning data, tracks:" << sortedTracks << "artists:" << sortedArtists << "scors:" << sortedScores;
|
||||||
|
|
||||||
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
|
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
|
||||||
|
|
||||||
emit info( requestData, returnedData );
|
emit info( requestData, returnedData );
|
||||||
|
|
||||||
|
if ( !sortedTracks.isEmpty() )
|
||||||
|
{
|
||||||
Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>();
|
Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>();
|
||||||
Tomahawk::InfoSystem::InfoStringHash criteria;
|
Tomahawk::InfoSystem::InfoStringHash criteria;
|
||||||
criteria["artist"] = origData["artist"];
|
criteria["artist"] = origData["artist"];
|
||||||
criteria["track"] = origData["track"];
|
criteria["track"] = origData["track"];
|
||||||
emit updateCache( criteria, 2419200000, requestData.type, returnedData );
|
emit updateCache( criteria, 2419200000, requestData.type, returnedData );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user