aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-01-05 03:52:00 +0000
committerMichael Olson <mwolson@gnu.org>2007-01-05 03:52:00 +0000
commit77c1f432b3b02151c82e035ba5f354817df7d426 (patch)
treeadcc50554e2336aba7fde8ae1552b29bc17d1052
parent1e446de1aec47d258e509183d126d0341001900f (diff)
emms-player-mpd: Use functions in emms-url.el
darcs-hash:20070105035233-1bfb2-6b83da8301b2ea542a061a6baab437fea1dade9e.gz
-rw-r--r--emms-player-mpd.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index fb64ff5..1b9b533 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -106,6 +106,13 @@
(require 'emms-source-playlist) ; for emms-source-file-parse-playlist
(require 'tq)
+(eval-when-compile
+ (condition-case nil
+ (progn
+ (require 'url) ; load if available
+ (require 'emms-url))
+ (error nil)))
+
(defgroup emms-player-mpd nil
"EMMS player for MusicPD."
:group 'emms-player
@@ -741,9 +748,12 @@ This handles both m3u and pls type playlists."
Execute CALLBACK with CLOSURE as its first argument when done."
;; This is useful with emms-streams.el
(if (fboundp 'url-insert-file-contents)
- (with-temp-buffer
- (url-insert-file-contents url)
- (emms-player-mpd-add-buffer-contents closure callback))
+ (progn
+ (require 'emms-url)
+ (with-temp-buffer
+ (url-insert-file-contents (emms-escape-url url))
+ (emms-http-decode-buffer)
+ (emms-player-mpd-add-buffer-contents closure callback)))
(error (message (concat "You need to install url.el so that"
" Emms can retrieve this stream")))))