From 9e258ab50949a1f5ebd84bf1121077f11a574fdd Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 30 May 2013 16:50:14 +0000 Subject: fixed scrobbler regressions git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3511 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/scrobbler/lastfmscrobbler.cpp | 7 ++++--- src/plugins/General/scrobbler/librefmscrobbler.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins/General/scrobbler') diff --git a/src/plugins/General/scrobbler/lastfmscrobbler.cpp b/src/plugins/General/scrobbler/lastfmscrobbler.cpp index 2a449c410..145cb1676 100644 --- a/src/plugins/General/scrobbler/lastfmscrobbler.cpp +++ b/src/plugins/General/scrobbler/lastfmscrobbler.cpp @@ -129,15 +129,15 @@ void LastfmScrobbler::setState(Qmmp::State state) switch ((uint) state) { case Qmmp::Playing: - if (previousState != Qmmp::Paused) + if (previousState != Qmmp::Paused) { qDebug("LastfmScrobbler: new song started"); m_start_ts = QDateTime::currentDateTime().toTime_t(); elapsed = 0; } - else + else { - qDebug("LastfmScrobbler: resuming after pause, %d seconds played", elapsed / 1000); + qDebug("LastfmScrobbler: resuming from %d seconds played", elapsed / 1000); } m_time->restart(); break; @@ -448,6 +448,7 @@ void LastfmAuth::getSession() void LastfmAuth::checkSession(const QString &session) { qDebug("LastfmAuth: checking session..."); + m_session = session; QMap params; params.insert("api_key", API_KEY); params.insert("sk", session); diff --git a/src/plugins/General/scrobbler/librefmscrobbler.cpp b/src/plugins/General/scrobbler/librefmscrobbler.cpp index 7ececc155..56ec4b7ea 100644 --- a/src/plugins/General/scrobbler/librefmscrobbler.cpp +++ b/src/plugins/General/scrobbler/librefmscrobbler.cpp @@ -90,9 +90,13 @@ void LibrefmScrobbler::setState(Qmmp::State state) if (previousState != Qmmp::Paused) { m_start_ts = QDateTime::currentDateTime().toTime_t(); - m_time->restart(); elapsed = 0; } + else + { + qDebug("LibrefmScrobbler: resuming from %d seconds played", elapsed / 1000); + } + m_time->restart(); if (!isReady() && !m_handshakeReply) handshake(); break; @@ -120,6 +124,7 @@ void LibrefmScrobbler::setState(Qmmp::State state) default: ; } + previousState = state; } void LibrefmScrobbler::updateMetaData() -- cgit v1.2.3-13-gbd6f