From 15e5fc9f8a3e28b5d478e5e0f75fe25e923a26f6 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 23 Oct 2014 16:16:06 +0200 Subject: contrib: Fix scrobbling script Time is measured in seconds since commit c872f00508ce4afe3b8ec863b23595c31fd8b4be. --- contrib/eventcmd-examples/scrobble.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/eventcmd-examples') 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: -- cgit v1.2.3