diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-21 16:32:47 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-02-21 16:32:47 +0000 |
| commit | 5b10a56f8568935ac80d9a6c72289ceab2512975 (patch) | |
| tree | 41dc056f805020f4296bb547ede4ea7c53f3f4d2 /src/plugins/General/scrobbler | |
| parent | 6836e3e28cab63a3bdfc743106de3e339283cb91 (diff) | |
| download | qmmp-5b10a56f8568935ac80d9a6c72289ceab2512975.tar.gz qmmp-5b10a56f8568935ac80d9a6c72289ceab2512975.tar.bz2 qmmp-5b10a56f8568935ac80d9a6c72289ceab2512975.zip | |
fixed scrobble conditions (patch by Ferdinand Vesely)(Closes issue 428)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2064 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/scrobbler')
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler.h | 2 | ||||
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler2.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler2.h | 2 |
4 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp index 0207f5a74..bfa236c11 100644 --- a/src/plugins/General/scrobbler/scrobbler.cpp +++ b/src/plugins/General/scrobbler/scrobbler.cpp @@ -135,7 +135,7 @@ void Scrobbler::setState(Qmmp::State state) case Qmmp::Stopped: if (!m_song.metaData().isEmpty() && ((m_time->elapsed ()/1000 > 240) || (m_time->elapsed ()/1000 > int(m_song.length()/2))) - && (m_time->elapsed ()/1000 > 60)) + && (m_song.length() > MIN_SONG_LENGTH)) { m_song.setTimeStamp(m_start_ts); m_songCache << m_song; diff --git a/src/plugins/General/scrobbler/scrobbler.h b/src/plugins/General/scrobbler/scrobbler.h index 0e733321d..da98a5ba6 100644 --- a/src/plugins/General/scrobbler/scrobbler.h +++ b/src/plugins/General/scrobbler/scrobbler.h @@ -82,6 +82,8 @@ private slots: void handshake(); private: + enum { MIN_SONG_LENGTH = 30 }; + void submit(); void sendNotification(const SongInfo &info); bool isReady(); diff --git a/src/plugins/General/scrobbler/scrobbler2.cpp b/src/plugins/General/scrobbler/scrobbler2.cpp index b73539fe3..7f25ec3d9 100644 --- a/src/plugins/General/scrobbler/scrobbler2.cpp +++ b/src/plugins/General/scrobbler/scrobbler2.cpp @@ -126,7 +126,7 @@ void Scrobbler2::setState(Qmmp::State state) case Qmmp::Stopped: if (!m_song.metaData().isEmpty() && ((m_time->elapsed ()/1000 > 240) || (m_time->elapsed ()/1000 > int(m_song.length()/2))) - && (m_time->elapsed ()/1000 > 60)) + && (m_song.length() > MIN_SONG_LENGTH)) { m_song.setTimeStamp(m_start_ts); m_songCache << m_song; diff --git a/src/plugins/General/scrobbler/scrobbler2.h b/src/plugins/General/scrobbler/scrobbler2.h index 36dc928c6..91ae10b1f 100644 --- a/src/plugins/General/scrobbler/scrobbler2.h +++ b/src/plugins/General/scrobbler/scrobbler2.h @@ -50,6 +50,8 @@ private slots: void submit(); private: + enum { MIN_SONG_LENGTH = 30 }; + void sendNotification(const SongInfo &info); void syncCache(); uint m_start_ts; |
