aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2006-12-16 13:22:00 +0000
committerTassilo Horn <tassilo@member.fsf.org>2006-12-16 13:22:00 +0000
commit1d3cb0de6c78bf62e9dca6a3c1715147da9bfc33 (patch)
treea1bb4133ac37d7c4575ac0cb1d056a9809c7e398
parent1207c51472e11e1bf937b33c706397726bc7c6c4 (diff)
fix-regression-in-lastfm.dpatch
My last path enabled emms-lastfm.el to submit tracks even if you paused them. I tested this extensively! But I didn't test if it still submits them if you don't pause it. Of course it didn't. ;-) The problem was that I rely on `emms-playing-time' to calculate when a track has to be submitted. But in `emms-player-started-hook' my new track function was run *before* `emms-playing-time' was set to 0 again. darcs-hash:20061216132209-c06f4-c25c2f5849e7492cec0cc0b95e347ce24db2a83d.gz
-rw-r--r--emms-lastfm.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/emms-lastfm.el b/emms-lastfm.el
index 402021e..a9308a8 100644
--- a/emms-lastfm.el
+++ b/emms-lastfm.el
@@ -114,8 +114,10 @@ the current track, too."
(progn
(add-hook 'emms-player-started-hook
'emms-lastfm-handshake-if-needed)
+ ;; Has to be appended, because it has to run after
+ ;; `emms-playing-time-start'
(add-hook 'emms-player-started-hook
- 'emms-lastfm-new-track-function)
+ 'emms-lastfm-new-track-function t)
(add-hook 'emms-player-stopped-hook
'emms-lastfm-cancel-timer)
(add-hook 'emms-player-paused-hook
@@ -126,9 +128,9 @@ the current track, too."
(remove-hook 'emms-player-started-hook
'emms-lastfm-new-track-function)
(remove-hook 'emms-player-stopped-hook
- 'emms-lastfm-pause)
- (remove-hook 'emms-player-paused-hook
'emms-lastfm-cancel-timer)
+ (remove-hook 'emms-player-paused-hook
+ 'emms-lastfm-pause)
(cancel-timer emms-lastfm-timer)
(setq emms-lastfm-md5-challenge nil
emms-lastfm-submit-url nil
@@ -136,7 +138,6 @@ the current track, too."
emms-lastfm-current-track nil)
(message "EMMS Last.fm plugin deactivated."))))
-
(defun read-line ()
(buffer-substring-no-properties (line-beginning-position)
(line-end-position)))