From 2a39355fb655ee3f99d9184040479cdbfe816fc5 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sat, 30 Apr 2011 17:10:36 -0400 Subject: [PATCH] Add pushInfo API to InfoSystem, and switch the LastFM Plugin over to using it --- .../infosystem/infoplugins/echonestplugin.cpp | 2 +- .../infosystem/infoplugins/echonestplugin.h | 16 +++ .../infosystem/infoplugins/lastfmplugin.cpp | 52 ++++---- .../infosystem/infoplugins/lastfmplugin.h | 6 +- .../infoplugins/musixmatchplugin.cpp | 2 +- .../infosystem/infoplugins/musixmatchplugin.h | 16 +++ src/libtomahawk/infosystem/infosystem.cpp | 25 +++- src/libtomahawk/infosystem/infosystem.h | 112 +++++++++--------- .../infosystem/infosystemworker.cpp | 33 ++++-- src/libtomahawk/infosystem/infosystemworker.h | 6 +- src/scrobbler.cpp | 18 +-- 11 files changed, 173 insertions(+), 115 deletions(-) diff --git a/src/libtomahawk/infosystem/infoplugins/echonestplugin.cpp b/src/libtomahawk/infosystem/infoplugins/echonestplugin.cpp index d5ccd2e70..d2d8f5879 100644 --- a/src/libtomahawk/infosystem/infoplugins/echonestplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/echonestplugin.cpp @@ -32,7 +32,7 @@ EchoNestPlugin::EchoNestPlugin(InfoSystemWorker *parent) qDebug() << Q_FUNC_INFO; QSet< InfoType > supportedTypes; supportedTypes << Tomahawk::InfoSystem::InfoArtistBiography << Tomahawk::InfoSystem::InfoArtistFamiliarity << Tomahawk::InfoSystem::InfoArtistHotttness << Tomahawk::InfoSystem::InfoArtistTerms << Tomahawk::InfoSystem::InfoMiscTopTerms; - parent->registerInfoTypes(this, supportedTypes); + parent->registerInfoTypes( this, supportedTypes, QSet< InfoType>() ); } EchoNestPlugin::~EchoNestPlugin() diff --git a/src/libtomahawk/infosystem/infoplugins/echonestplugin.h b/src/libtomahawk/infosystem/infoplugins/echonestplugin.h index 29fa691d6..7537861e8 100644 --- a/src/libtomahawk/infosystem/infoplugins/echonestplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/echonestplugin.h @@ -46,6 +46,22 @@ public: protected slots: virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); + virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data ) + { + Q_UNUSED( caller ); + Q_UNUSED( type ); + Q_UNUSED( data ); + } + + virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) + { + Q_UNUSED( criteria ); + Q_UNUSED( caller ); + Q_UNUSED( type ); + Q_UNUSED( input ); + Q_UNUSED( customData ); + } + private: void getSongProfile( const QString &caller, const QVariant &input, const InfoCustomData &customData, const QString &item = QString() ); void getArtistBiography ( const QString &caller, const QVariant &input, const InfoCustomData &customData ); diff --git a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.cpp b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.cpp index 36d4f3976..ece3764d2 100644 --- a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.cpp @@ -47,9 +47,10 @@ LastFmPlugin::LastFmPlugin( InfoSystemWorker* parent ) , m_authJob( 0 ) , m_infoSystemWorker( parent ) { - QSet< InfoType > supportedTypes; - supportedTypes << InfoMiscSubmitScrobble << InfoMiscSubmitNowPlaying << InfoAlbumCoverArt << InfoArtistImages; - parent->registerInfoTypes(this, supportedTypes); + QSet< InfoType > supportedGetTypes, supportedPushTypes; + supportedGetTypes << InfoAlbumCoverArt << InfoArtistImages; + supportedPushTypes << InfoSubmitScrobble << InfoSubmitNowPlaying; + parent->registerInfoTypes( this, supportedGetTypes, supportedPushTypes ); /* Your API Key is 7194b85b6d1f424fe1668173a78c0c4a @@ -110,14 +111,6 @@ LastFmPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp switch ( type ) { - case InfoMiscSubmitNowPlaying: - nowPlaying( caller, type, input, customData ); - break; - - case InfoMiscSubmitScrobble: - scrobble( caller, type, input, customData ); - break; - case InfoArtistImages: fetchArtistImages( caller, type, input, customData ); break; @@ -133,19 +126,34 @@ LastFmPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp void -LastFmPlugin::nowPlaying( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ) +LastFmPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input ) +{ + qDebug() << Q_FUNC_INFO; + + switch ( type ) + { + case InfoSubmitNowPlaying: + nowPlaying( caller, type, input ); + break; + + case InfoSubmitScrobble: + scrobble( caller, type, input ); + break; + + default: + return; + } +} + +void +LastFmPlugin::nowPlaying( const QString &caller, const InfoType type, const QVariant &input ) { if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() || !m_scrobbler ) - { - dataError( caller, type, input, customData ); return; - } + InfoCriteriaHash hash = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); if ( !hash.contains( "title" ) || !hash.contains( "artist" ) || !hash.contains( "album" ) || !hash.contains( "duration" ) ) - { - dataError( caller, type, input, customData ); return; - } m_track = lastfm::MutableTrack(); m_track.stamp(); @@ -158,26 +166,20 @@ LastFmPlugin::nowPlaying( const QString &caller, const InfoType type, const QVar m_track.setSource( lastfm::Track::Player ); m_scrobbler->nowPlaying( m_track ); - emit info( caller, type, input, QVariant(), customData ); } void -LastFmPlugin::scrobble( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ) +LastFmPlugin::scrobble( const QString &caller, const InfoType type, const QVariant &input ) { Q_ASSERT( QThread::currentThread() == thread() ); if ( !m_scrobbler || m_track.isNull() ) - { - dataError( caller, type, input, customData ); return; - } qDebug() << Q_FUNC_INFO << m_track.toString(); m_scrobbler->cache( m_track ); m_scrobbler->submit(); - - emit info( caller, type, input, QVariant(), customData ); } diff --git a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h index d1e9e1011..c393c9b00 100644 --- a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h @@ -54,14 +54,16 @@ public slots: protected slots: virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); + + virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data ); private: void fetchCoverArt( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ); void fetchArtistImages( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ); void createScrobbler(); - void scrobble( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ); - void nowPlaying( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ); + void scrobble( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input ); + void nowPlaying( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input ); void dataError( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData ); diff --git a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.cpp b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.cpp index 2b51fe158..f8698c0f4 100644 --- a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.cpp @@ -35,7 +35,7 @@ MusixMatchPlugin::MusixMatchPlugin(InfoSystemWorker *parent) qDebug() << Q_FUNC_INFO; QSet< InfoType > supportedTypes; supportedTypes << Tomahawk::InfoSystem::InfoTrackLyrics; - parent->registerInfoTypes(this, supportedTypes); + parent->registerInfoTypes( this, supportedTypes, QSet< InfoType>() ); } MusixMatchPlugin::~MusixMatchPlugin() diff --git a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h index dda756450..f2d7e87b8 100644 --- a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h @@ -44,6 +44,22 @@ public slots: protected slots: virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); + + virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data ) + { + Q_UNUSED( caller ); + Q_UNUSED( type ); + Q_UNUSED( data ); + } + + virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) + { + Q_UNUSED( criteria ); + Q_UNUSED( caller ); + Q_UNUSED( type ); + Q_UNUSED( input ); + Q_UNUSED( customData ); + } private: bool isValidTrackData( const QString &caller, const QVariant &input, const InfoCustomData &customData ); diff --git a/src/libtomahawk/infosystem/infosystem.cpp b/src/libtomahawk/infosystem/infosystem.cpp index d8feaf002..da3418feb 100644 --- a/src/libtomahawk/infosystem/infosystem.cpp +++ b/src/libtomahawk/infosystem/infosystem.cpp @@ -131,7 +131,7 @@ InfoSystem::newNam() const void -InfoSystem::getInfo(const QString &caller, const InfoType type, const QVariant& input, InfoCustomData customData) +InfoSystem::getInfo( const QString &caller, const InfoType type, const QVariant& input, InfoCustomData customData ) { qDebug() << Q_FUNC_INFO; @@ -142,15 +142,32 @@ InfoSystem::getInfo(const QString &caller, const InfoType type, const QVariant& void -InfoSystem::getInfo(const QString &caller, const InfoMap &input, InfoCustomData customData) +InfoSystem::getInfo( const QString &caller, const InfoMap &input, InfoCustomData customData ) { Q_FOREACH( InfoType type, input.keys() ) - getInfo(caller, type, input[type], customData); + getInfo( caller, type, input[type], customData ); } void -InfoSystem::infoSlot(QString target, InfoType type, QVariant input, QVariant output, InfoCustomData customData) +InfoSystem::pushInfo( const QString &caller, const InfoType type, const QVariant& input ) +{ + qDebug() << Q_FUNC_INFO; + + QMetaObject::invokeMethod( m_worker, "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ) ); +} + + +void +InfoSystem::pushInfo( const QString &caller, const InfoMap &input ) +{ + Q_FOREACH( InfoType type, input.keys() ) + pushInfo( caller, type, input[type] ); +} + + +void +InfoSystem::infoSlot( QString target, InfoType type, QVariant input, QVariant output, InfoCustomData customData ) { qDebug() << Q_FUNC_INFO; qDebug() << "current count in dataTracker is " << m_dataTracker[target][type]; diff --git a/src/libtomahawk/infosystem/infosystem.h b/src/libtomahawk/infosystem/infosystem.h index ae1e17b6a..556ab2742 100644 --- a/src/libtomahawk/infosystem/infosystem.h +++ b/src/libtomahawk/infosystem/infosystem.h @@ -38,61 +38,61 @@ namespace InfoSystem { class InfoSystemCache; class InfoSystemWorker; -enum InfoType { +enum InfoType { // as items are saved in cache, mark them here to not change them InfoTrackID = 0, - InfoTrackArtist, - InfoTrackAlbum, - InfoTrackGenre, - InfoTrackComposer, - InfoTrackDate, - InfoTrackNumber, - InfoTrackDiscNumber, - InfoTrackBitRate, - InfoTrackLength, - InfoTrackSampleRate, - InfoTrackFileSize, - InfoTrackBPM, - InfoTrackReplayGain, - InfoTrackReplayPeakGain, - InfoTrackLyrics, - InfoTrackLocation, - InfoTrackProfile, - InfoTrackEnergy, - InfoTrackDanceability, - InfoTrackTempo, - InfoTrackLoudness, + InfoTrackArtist = 1, + InfoTrackAlbum = 2, + InfoTrackGenre = 3, + InfoTrackComposer = 4, + InfoTrackDate = 5, + InfoTrackNumber = 6, + InfoTrackDiscNumber = 7, + InfoTrackBitRate = 8, + InfoTrackLength = 9, + InfoTrackSampleRate = 10, + InfoTrackFileSize = 11, + InfoTrackBPM = 12, + InfoTrackReplayGain = 13, + InfoTrackReplayPeakGain = 14, + InfoTrackLyrics = 15, + InfoTrackLocation = 16, + InfoTrackProfile = 17, + InfoTrackEnergy = 18, + InfoTrackDanceability = 19, + InfoTrackTempo = 20, + InfoTrackLoudness = 21, - InfoArtistID, - InfoArtistName, - InfoArtistBiography, - InfoArtistBlog, - InfoArtistFamiliarity, - InfoArtistHotttness, - InfoArtistImages, - InfoArtistNews, - InfoArtistProfile, - InfoArtistReviews, - InfoArtistSongs, - InfoArtistSimilars, - InfoArtistTerms, - InfoArtistLinks, - InfoArtistVideos, + InfoArtistID = 22, + InfoArtistName = 23, + InfoArtistBiography = 24, + InfoArtistBlog = 25, + InfoArtistFamiliarity = 26, + InfoArtistHotttness = 27, + InfoArtistImages = 28, + InfoArtistNews = 29, + InfoArtistProfile = 30, + InfoArtistReviews = 31, + InfoArtistSongs = 32, + InfoArtistSimilars = 33, + InfoArtistTerms = 34, + InfoArtistLinks = 35, + InfoArtistVideos = 36, - InfoAlbumID, - InfoAlbumName, - InfoAlbumArtist, - InfoAlbumDate, - InfoAlbumGenre, - InfoAlbumComposer, - InfoAlbumCoverArt, + InfoAlbumID = 37, + InfoAlbumName = 38, + InfoAlbumArtist = 39, + InfoAlbumDate = 40, + InfoAlbumGenre = 41, + InfoAlbumComposer = 42, + InfoAlbumCoverArt = 43, //cached -- do not change - InfoMiscTopHotttness, - InfoMiscTopTerms, + InfoMiscTopHotttness = 44, + InfoMiscTopTerms = 45, - InfoMiscSubmitNowPlaying, - InfoMiscSubmitScrobble, + InfoSubmitNowPlaying = 46, + InfoSubmitScrobble = 47, - InfoNoInfo + InfoNoInfo = 48 }; typedef QMap< InfoType, QVariant > InfoMap; @@ -120,16 +120,8 @@ signals: protected slots: virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data, const Tomahawk::InfoSystem::InfoCustomData customData ) = 0; - - //FIXME: Make pure virtual when everything supports it - virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) - { - Q_UNUSED( criteria ); - Q_UNUSED( caller ); - Q_UNUSED( type ); - Q_UNUSED( input ); - Q_UNUSED( customData ); - } + virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data ) = 0; + virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) = 0; protected: InfoType m_type; @@ -152,6 +144,8 @@ public: void getInfo( const QString &caller, const InfoType type, const QVariant &input, InfoCustomData customData ); void getInfo( const QString &caller, const InfoMap &input, InfoCustomData customData ); + void pushInfo( const QString &caller, const InfoType type, const QVariant &input ); + void pushInfo( const QString &caller, const InfoMap &input ); InfoSystemCache* getCache() const { return m_cache; } void newNam() const; diff --git a/src/libtomahawk/infosystem/infosystemworker.cpp b/src/libtomahawk/infosystem/infosystemworker.cpp index 020c58d44..f559d5ce4 100644 --- a/src/libtomahawk/infosystem/infosystemworker.cpp +++ b/src/libtomahawk/infosystem/infosystemworker.cpp @@ -89,21 +89,23 @@ InfoSystemWorker::~InfoSystemWorker() void -InfoSystemWorker::registerInfoTypes(const InfoPluginPtr &plugin, const QSet< InfoType >& types) +InfoSystemWorker::registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType >& getTypes, const QSet< InfoType >& pushTypes ) { qDebug() << Q_FUNC_INFO; - Q_FOREACH(InfoType type, types) - m_infoMap[type].append(plugin); + Q_FOREACH( InfoType type, getTypes ) + m_infoGetMap[type].append( plugin ); + Q_FOREACH( InfoType type, pushTypes ) + m_infoPushMap[type].append( plugin ); } QLinkedList< InfoPluginPtr > -InfoSystemWorker::determineOrderedMatches(const InfoType type) const +InfoSystemWorker::determineOrderedMatches( const InfoType type ) const { //Dummy function for now that returns the various items in the QSet; at some point this will //probably need to support ordering based on the data source QLinkedList< InfoPluginPtr > providers; - Q_FOREACH(InfoPluginPtr ptr, m_infoMap[type]) + Q_FOREACH( InfoPluginPtr ptr, m_infoGetMap[type] ) providers << ptr; return providers; } @@ -114,16 +116,16 @@ InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, InfoCu { qDebug() << Q_FUNC_INFO; QLinkedList< InfoPluginPtr > providers = determineOrderedMatches(type); - if (providers.isEmpty()) + if ( providers.isEmpty() ) { - emit info(caller, type, QVariant(), QVariant(), customData); + emit info( caller, type, QVariant(), QVariant(), customData ); return; } InfoPluginPtr ptr = providers.first(); - if (!ptr) + if ( !ptr ) { - emit info(caller, type, QVariant(), QVariant(), customData); + emit info( caller, type, QVariant(), QVariant(), customData ); return; } @@ -131,6 +133,19 @@ InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, InfoCu } +void +InfoSystemWorker::pushInfo( const QString caller, const InfoType type, const QVariant input ) +{ + qDebug() << Q_FUNC_INFO; + + Q_FOREACH( InfoPluginPtr ptr, m_infoPushMap[type] ) + { + if( ptr ) + QMetaObject::invokeMethod( ptr.data(), "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ) ); + } +} + + QNetworkAccessManager* InfoSystemWorker::nam() const { diff --git a/src/libtomahawk/infosystem/infosystemworker.h b/src/libtomahawk/infosystem/infosystemworker.h index a05767195..51eea4db5 100644 --- a/src/libtomahawk/infosystem/infosystemworker.h +++ b/src/libtomahawk/infosystem/infosystemworker.h @@ -44,7 +44,7 @@ public: InfoSystemWorker(); ~InfoSystemWorker(); - void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &types ); + void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &getTypes, const QSet< InfoType > &pushTypes ); QNetworkAccessManager* nam() const; signals: @@ -52,6 +52,7 @@ signals: public slots: void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); + void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input ); void newNam(); private: @@ -60,7 +61,8 @@ private: // For now, statically instantiate plugins; this is just somewhere to keep them QLinkedList< InfoPluginPtr > m_plugins; - QMap< InfoType, QLinkedList< InfoPluginPtr > > m_infoMap; + QMap< InfoType, QLinkedList< InfoPluginPtr > > m_infoGetMap; + QMap< InfoType, QLinkedList< InfoPluginPtr > > m_infoPushMap; QNetworkAccessManager *m_nam; }; diff --git a/src/scrobbler.cpp b/src/scrobbler.cpp index 2c5d572b4..bcaee8e0f 100644 --- a/src/scrobbler.cpp +++ b/src/scrobbler.cpp @@ -80,9 +80,9 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track ) trackInfo["artist"] = track->artist()->name(); trackInfo["album"] = track->album()->name(); trackInfo["duration"] = QString::number( track->duration() ); - Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( - s_scInfoIdentifier, Tomahawk::InfoSystem::InfoMiscSubmitNowPlaying, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() ); + Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( + s_scInfoIdentifier, Tomahawk::InfoSystem::InfoSubmitNowPlaying, + QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); m_scrobblePoint = ScrobblePoint( track->duration() / 2 ); } @@ -128,9 +128,9 @@ Scrobbler::scrobble() { Q_ASSERT( QThread::currentThread() == thread() ); - Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( - s_scInfoIdentifier, Tomahawk::InfoSystem::InfoMiscSubmitScrobble, - QVariant(), Tomahawk::InfoSystem::InfoCustomData() ); + Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( + s_scInfoIdentifier, Tomahawk::InfoSystem::InfoSubmitScrobble, + QVariant() ); } @@ -141,13 +141,7 @@ Scrobbler::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Q_UNUSED( output ); Q_UNUSED( customData ); if ( caller == s_scInfoIdentifier ) - { qDebug() << Q_FUNC_INFO; - if ( type == Tomahawk::InfoSystem::InfoMiscSubmitNowPlaying ) - qDebug() << "Scrobbler received now playing response from InfoSystem"; - else if ( type == Tomahawk::InfoSystem::InfoMiscSubmitScrobble ) - qDebug() << "Scrobbler received scrobble response from InfoSystem"; - } }