From 3bcb9452259783c843444e0342468d2b566ab38f Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 4 Aug 2006 18:53:00 +0000 Subject: emms-player-mpd: Use better logic for last patch. darcs-hash:20060804185308-1bfb2-ae78a2fb0939d2265454d088eee6881b780f89be.gz --- emms-player-mpd.el | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/emms-player-mpd.el b/emms-player-mpd.el index e01c7da..678382f 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -1071,20 +1071,19 @@ If INFO is specified, use that instead of acquiring the necessary info from MusicPD." (if info (emms-info-mpd-process track info) - (let (file) - (when (or emms-player-mpd-music-directory - (and (eq 'file (emms-track-type track)) - (setq file (emms-player-mpd-get-mpd-filename - (emms-track-name track))) - (string-match emms-player-mpd-supported-regexp file) - (not (string-match "\\`http://" file)))) - (condition-case nil - (emms-player-mpd-send - (concat "find filename " - (emms-player-mpd-quote-file file)) - track - #'emms-info-mpd-1) - (error nil)))))) + (when (and (eq 'file (emms-track-type track)) + (not (string-match "\\`http://" file))) + (let ((file (emms-player-mpd-get-mpd-filename (emms-track-name track)))) + (when (or emms-player-mpd-music-directory + (and file + (string-match emms-player-mpd-supported-regexp file))) + (condition-case nil + (emms-player-mpd-send + (concat "find filename " + (emms-player-mpd-quote-file file)) + track + #'emms-info-mpd-1) + (error nil))))))) ;;; Caching -- cgit v1.2.3