diff options
author | Steven Fan <steven.z.fan@gmail.com> | 2010-11-25 10:59:59 +1100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-10 19:45:27 +0200 |
commit | 3801c7a76992e47ed6dbf84160d9929dca5fb6a2 (patch) | |
tree | e8aef49bbe7912470b12b1d6dddc2c9e165769ac /plugins/lastfm | |
parent | 3e2f37c421937b494f13fd48a7c3d4955c01eea7 (diff) |
fix lastfm scrobble not subbmitting with skipped tracks
changed scrobble event from DB_EV_SONGFINISHED to DB_EV_SONGCHANGED
Diffstat (limited to 'plugins/lastfm')
-rw-r--r-- | plugins/lastfm/lastfm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c index b29355b1..14299a54 100644 --- a/plugins/lastfm/lastfm.c +++ b/plugins/lastfm/lastfm.c @@ -512,6 +512,10 @@ lastfm_songfinished (DB_event_track_t *ev, uintptr_t data) { if (!deadbeef->conf_get_int ("lastfm.enable", 0)) { return 0; } + // previous track must exist + if (!ev->track) { + return 0; + } #if !LFM_IGNORE_RULES // check submission rules // duration must be >= 30 sec @@ -807,7 +811,7 @@ lastfm_start (void) { lfm_tid = deadbeef->thread_start (lfm_thread, NULL); // subscribe to frameupdate event deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGSTARTED, DB_CALLBACK (lastfm_songstarted), 0); - deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGFINISHED, DB_CALLBACK (lastfm_songfinished), 0); + deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (lastfm_songfinished), 0); return 0; } @@ -818,7 +822,7 @@ lastfm_stop (void) { if (lfm_mutex) { lfm_stopthread = 1; deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGSTARTED, DB_CALLBACK (lastfm_songstarted), 0); - deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGFINISHED, DB_CALLBACK (lastfm_songfinished), 0); + deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (lastfm_songfinished), 0); trace ("lfm_stop signalling cond\n"); deadbeef->cond_signal (lfm_cond); |