aboutsummaryrefslogtreecommitdiff
path: root/emms-lastfm.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-08-19 15:37:00 +0000
committerMichael Olson <mwolson@gnu.org>2007-08-19 15:37:00 +0000
commitec320ca6d98d0ec22ce286bb8ed8ce99ee6aa0a5 (patch)
treee74dc32bdb6ff2788eee222f120a17850403c9e9 /emms-lastfm.el
parent8365f1c808490ad348c8fba82ea57f91cb1c996f (diff)
emms-lastfm: New option emms-lastfm-submission-verbose-p
This controls whether EMMS notifies the user every time a track is submitted. The default is not to do so. darcs-hash:20070819153739-1bfb2-89fecc3a7a5a66330a3608466b2d37967ad200ed.gz
Diffstat (limited to 'emms-lastfm.el')
-rw-r--r--emms-lastfm.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/emms-lastfm.el b/emms-lastfm.el
index 2d7493c..ebbed86 100644
--- a/emms-lastfm.el
+++ b/emms-lastfm.el
@@ -96,6 +96,11 @@
:type 'string
:group 'emms-lastfm)
+(defcustom emms-lastfm-submission-verbose-p nil
+ "If non-nil, display a message every time we submit a track to Last.fm."
+ :type 'boolean
+ :group 'emms-lastfm)
+
(defconst emms-lastfm-server "http://post.audioscrobbler.com/"
"The last.fm server responsible for the handshaking
procedure. Only for internal use.")
@@ -264,6 +269,7 @@ last.fm."
'info-playing-time)))
(date (format-time-string "%Y-%m-%d %H:%M:%S" (current-time) t))
(url-http-attempt-keepalives nil)
+ (url-show-status emms-lastfm-submission-verbose-p)
(url-request-method "POST")
(url-request-extra-headers
'(("Content-type" .
@@ -291,8 +297,9 @@ well or if an error occured."
(goto-char (point-min))
(if (re-search-forward "^OK$" nil t)
(progn
- (message "EMMS: \"%s\" submitted to last.fm"
- (emms-track-description emms-lastfm-current-track))
+ (when emms-lastfm-submission-verbose-p
+ (message "EMMS: \"%s\" submitted to last.fm"
+ (emms-track-description emms-lastfm-current-track)))
(kill-buffer buffer))
(message "EMMS: Song couldn't be submitted to last.fm")
(goto-char (point-min))