mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 05:07:27 +02:00
* Fixed usage of new liblastfm.
This commit is contained in:
@@ -99,9 +99,9 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
|
|||||||
|
|
||||||
// liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid.
|
// liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid.
|
||||||
if ( track->duration() == 0 )
|
if ( track->duration() == 0 )
|
||||||
m_scrobblePoint = ScrobblePoint( 30 );
|
m_scrobblePoint = lastfm::ScrobblePoint( 30 );
|
||||||
else
|
else
|
||||||
m_scrobblePoint = ScrobblePoint( track->duration() / 2 );
|
m_scrobblePoint = lastfm::ScrobblePoint( track->duration() / 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#ifndef TOMAHAWK_SCROBBLER_H
|
#ifndef TOMAHAWK_SCROBBLER_H
|
||||||
#define TOMAHAWK_SCROBBLER_H
|
#define TOMAHAWK_SCROBBLER_H
|
||||||
|
|
||||||
#include "lastfm/ScrobblePoint"
|
#include "lastfm/ScrobblePoint.h"
|
||||||
#include "Result.h"
|
#include "Result.h"
|
||||||
#include "infosystem/InfoSystem.h"
|
#include "infosystem/InfoSystem.h"
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ private:
|
|||||||
void scrobble();
|
void scrobble();
|
||||||
|
|
||||||
bool m_reachedScrobblePoint;
|
bool m_reachedScrobblePoint;
|
||||||
ScrobblePoint m_scrobblePoint;
|
lastfm::ScrobblePoint m_scrobblePoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ namespace Tomahawk
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LIBLASTFM_FOUND
|
#ifdef LIBLASTFM_FOUND
|
||||||
#include <lastfm/NetworkAccessManager>
|
#include <lastfm/NetworkAccessManager.h>
|
||||||
#include "Scrobbler.h"
|
#include "Scrobbler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
#include "utils/TomahawkUtils.h"
|
#include "utils/TomahawkUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "lastfm/ws.h"
|
#include "lastfm/ws.h"
|
||||||
#include "lastfm/User"
|
#include "lastfm/User.h"
|
||||||
#include "lastfm/XmlQuery"
|
#include "lastfm/XmlQuery.h"
|
||||||
|
|
||||||
using namespace Tomahawk::Accounts;
|
using namespace Tomahawk::Accounts;
|
||||||
|
|
||||||
@@ -135,7 +135,8 @@ LastFmConfig::onHistoryLoaded()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lastfm::XmlQuery lfm = reply->readAll();
|
lastfm::XmlQuery lfm;
|
||||||
|
lfm.parse( reply->readAll() );
|
||||||
|
|
||||||
foreach ( lastfm::XmlQuery e, lfm.children( "track" ) )
|
foreach ( lastfm::XmlQuery e, lfm.children( "track" ) )
|
||||||
{
|
{
|
||||||
@@ -170,7 +171,7 @@ LastFmConfig::onHistoryLoaded()
|
|||||||
}
|
}
|
||||||
catch( lastfm::ws::ParseError e )
|
catch( lastfm::ws::ParseError e )
|
||||||
{
|
{
|
||||||
tDebug() << "XmlQuery error:" << e.what();
|
tDebug() << "XmlQuery error:" << e.message();
|
||||||
finished = true;
|
finished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +201,8 @@ LastFmConfig::onLastFmFinished()
|
|||||||
}
|
}
|
||||||
if( authJob->error() == QNetworkReply::NoError )
|
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 )
|
if( lfm.children( "error" ).size() > 0 )
|
||||||
{
|
{
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
|
|
||||||
#include <lastfm/ws.h>
|
#include <lastfm/ws.h>
|
||||||
#include <lastfm/XmlQuery>
|
#include <lastfm/XmlQuery.h>
|
||||||
|
|
||||||
#include <qjson/parser.h>
|
#include <qjson/parser.h>
|
||||||
|
|
||||||
@@ -871,7 +871,8 @@ LastFmInfoPlugin::onAuthenticated()
|
|||||||
|
|
||||||
if ( authJob->error() == QNetworkReply::NoError )
|
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 )
|
if ( lfm.children( "error" ).size() > 0 )
|
||||||
{
|
{
|
||||||
@@ -933,7 +934,8 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
|
|||||||
QList<lastfm::Track> tracks;
|
QList<lastfm::Track> tracks;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lastfm::XmlQuery lfm = reply->readAll();
|
lastfm::XmlQuery lfm;
|
||||||
|
lfm.parse( reply->readAll() );
|
||||||
foreach ( lastfm::XmlQuery xq, lfm.children( "track" ) )
|
foreach ( lastfm::XmlQuery xq, lfm.children( "track" ) )
|
||||||
{
|
{
|
||||||
tracks.append( lastfm::Track( xq ) );
|
tracks.append( lastfm::Track( xq ) );
|
||||||
@@ -941,7 +943,7 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
|
|||||||
}
|
}
|
||||||
catch ( lastfm::ws::ParseError& e )
|
catch ( lastfm::ws::ParseError& e )
|
||||||
{
|
{
|
||||||
qWarning() << e.what();
|
qWarning() << e.message();
|
||||||
}
|
}
|
||||||
|
|
||||||
return tracks;
|
return tracks;
|
||||||
|
@@ -24,9 +24,9 @@
|
|||||||
#include "infosystem/InfoSystemWorker.h"
|
#include "infosystem/InfoSystemWorker.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <lastfm/Track>
|
#include <lastfm/Track.h>
|
||||||
#include <lastfm/Audioscrobbler>
|
#include <lastfm/Audioscrobbler.h>
|
||||||
#include <lastfm/ScrobblePoint>
|
#include <lastfm/ScrobblePoint.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user