diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-10-23 16:16:06 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-10-23 16:16:06 +0200 |
commit | 15e5fc9f8a3e28b5d478e5e0f75fe25e923a26f6 (patch) | |
tree | f64e947624477715e0cf2e26c2f9f226f8cac747 | |
parent | 74e48104447b27f99c93675c041bc79fed4bdf28 (diff) | |
download | pianobar-15e5fc9f8a3e28b5d478e5e0f75fe25e923a26f6.tar.gz pianobar-15e5fc9f8a3e28b5d478e5e0f75fe25e923a26f6.tar.bz2 pianobar-15e5fc9f8a3e28b5d478e5e0f75fe25e923a26f6.zip |
contrib: Fix scrobbling script
Time is measured in seconds since commit
c872f00508ce4afe3b8ec863b23595c31fd8b4be.
-rwxr-xr-x | contrib/eventcmd-examples/scrobble.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/eventcmd-examples/scrobble.py b/contrib/eventcmd-examples/scrobble.py index 99f328c..2fb5303 100755 --- a/contrib/eventcmd-examples/scrobble.py +++ b/contrib/eventcmd-examples/scrobble.py @@ -65,8 +65,8 @@ def main(): # events: songstart, songfinish, ??? import pylast - if event == "songfinish" and song_duration > 1000*MIN_DURATION and (100.0 * song_played / song_duration > THRESHOLD or song_played > 1000*PLAYED_ENOUGH): - song_started = int(time.time() - song_played / 1000.0) + if event == "songfinish" and song_duration > MIN_DURATION and (100.0 * song_played / song_duration > THRESHOLD or song_played > PLAYED_ENOUGH): + song_started = int(time.time() - song_played) network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = API_SECRET, username = USERNAME, password_hash = pylast.md5(PASSWORD)) network.scrobble(artist = artist, title = title, timestamp = song_started) if event == "songfinish" and rating > 0: |