Skip to content

Commit

Permalink
* Fixed usage of new liblastfm.
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Jun 11, 2012
1 parent d16c608 commit a9a86f8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Scrobbler.cpp
Expand Up @@ -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 );
}


Expand Down
4 changes: 2 additions & 2 deletions src/Scrobbler.h
Expand Up @@ -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"

Expand Down Expand Up @@ -51,7 +51,7 @@ public slots:
void scrobble();

bool m_reachedScrobblePoint;
ScrobblePoint m_scrobblePoint;
lastfm::ScrobblePoint m_scrobblePoint;
};


Expand Down
2 changes: 1 addition & 1 deletion src/TomahawkApp.h
Expand Up @@ -64,7 +64,7 @@ namespace Tomahawk
}

#ifdef LIBLASTFM_FOUND
#include <lastfm/NetworkAccessManager>
#include <lastfm/NetworkAccessManager.h>
#include "Scrobbler.h"
#endif

Expand Down
12 changes: 7 additions & 5 deletions src/libtomahawk/accounts/lastfm/LastFmConfig.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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" ) )
{
Expand Down Expand Up @@ -170,7 +171,7 @@ LastFmConfig::onHistoryLoaded()
}
catch( lastfm::ws::ParseError e )
{
tDebug() << "XmlQuery error:" << e.what();
tDebug() << "XmlQuery error:" << e.message();
finished = true;
}

Expand Down Expand Up @@ -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 )
{
Expand Down
10 changes: 6 additions & 4 deletions src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp
Expand Up @@ -34,7 +34,7 @@
#include "TomahawkSettings.h"

#include <lastfm/ws.h>
#include <lastfm/XmlQuery>
#include <lastfm/XmlQuery.h>

#include <qjson/parser.h>

Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -933,15 +934,16 @@ 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 ) );
}
}
catch ( lastfm::ws::ParseError& e )
{
qWarning() << e.what();
qWarning() << e.message();
}

return tracks;
Expand Down
6 changes: 3 additions & 3 deletions src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h
Expand Up @@ -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>

Expand Down

0 comments on commit a9a86f8

Please sign in to comment.