1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

* Fixed usage of new liblastfm.

This commit is contained in:
Christian Muehlhaeuser 2012-06-11 21:14:21 +02:00
parent d16c608610
commit a9a86f8043
6 changed files with 21 additions and 17 deletions

View File

@ -99,9 +99,9 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
// liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid.
if ( track->duration() == 0 )
m_scrobblePoint = ScrobblePoint( 30 );
m_scrobblePoint = lastfm::ScrobblePoint( 30 );
else
m_scrobblePoint = ScrobblePoint( track->duration() / 2 );
m_scrobblePoint = lastfm::ScrobblePoint( track->duration() / 2 );
}

View File

@ -20,7 +20,7 @@
#ifndef TOMAHAWK_SCROBBLER_H
#define TOMAHAWK_SCROBBLER_H
#include "lastfm/ScrobblePoint"
#include "lastfm/ScrobblePoint.h"
#include "Result.h"
#include "infosystem/InfoSystem.h"
@ -51,7 +51,7 @@ private:
void scrobble();
bool m_reachedScrobblePoint;
ScrobblePoint m_scrobblePoint;
lastfm::ScrobblePoint m_scrobblePoint;
};

View File

@ -64,7 +64,7 @@ namespace Tomahawk
}
#ifdef LIBLASTFM_FOUND
#include <lastfm/NetworkAccessManager>
#include <lastfm/NetworkAccessManager.h>
#include "Scrobbler.h"
#endif

View File

@ -25,8 +25,8 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "lastfm/ws.h"
#include "lastfm/User"
#include "lastfm/XmlQuery"
#include "lastfm/User.h"
#include "lastfm/XmlQuery.h"
using namespace Tomahawk::Accounts;
@ -135,7 +135,8 @@ LastFmConfig::onHistoryLoaded()
try
{
lastfm::XmlQuery lfm = reply->readAll();
lastfm::XmlQuery lfm;
lfm.parse( reply->readAll() );
foreach ( lastfm::XmlQuery e, lfm.children( "track" ) )
{
@ -170,7 +171,7 @@ LastFmConfig::onHistoryLoaded()
}
catch( lastfm::ws::ParseError e )
{
tDebug() << "XmlQuery error:" << e.what();
tDebug() << "XmlQuery error:" << e.message();
finished = true;
}
@ -200,7 +201,8 @@ LastFmConfig::onLastFmFinished()
}
if( authJob->error() == QNetworkReply::NoError )
{
lastfm::XmlQuery lfm = lastfm::XmlQuery( authJob->readAll() );
lastfm::XmlQuery lfm;
lfm.parse( authJob->readAll() );
if( lfm.children( "error" ).size() > 0 )
{

View File

@ -34,7 +34,7 @@
#include "TomahawkSettings.h"
#include <lastfm/ws.h>
#include <lastfm/XmlQuery>
#include <lastfm/XmlQuery.h>
#include <qjson/parser.h>
@ -871,7 +871,8 @@ LastFmInfoPlugin::onAuthenticated()
if ( authJob->error() == QNetworkReply::NoError )
{
lastfm::XmlQuery lfm = lastfm::XmlQuery( authJob->readAll() );
lastfm::XmlQuery lfm;
lfm.parse( authJob->readAll() );
if ( lfm.children( "error" ).size() > 0 )
{
@ -933,7 +934,8 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
QList<lastfm::Track> tracks;
try
{
lastfm::XmlQuery lfm = reply->readAll();
lastfm::XmlQuery lfm;
lfm.parse( reply->readAll() );
foreach ( lastfm::XmlQuery xq, lfm.children( "track" ) )
{
tracks.append( lastfm::Track( xq ) );
@ -941,7 +943,7 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
}
catch ( lastfm::ws::ParseError& e )
{
qWarning() << e.what();
qWarning() << e.message();
}
return tracks;

View File

@ -24,9 +24,9 @@
#include "infosystem/InfoSystemWorker.h"
#include "DllMacro.h"
#include <lastfm/Track>
#include <lastfm/Audioscrobbler>
#include <lastfm/ScrobblePoint>
#include <lastfm/Track.h>
#include <lastfm/Audioscrobbler.h>
#include <lastfm/ScrobblePoint.h>
#include <QObject>