aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2015-10-14 19:00:31 -0400
committerMark Oteiza2015-10-14 19:00:31 -0400
commit453af81f16a7eca0bc246c9278d19ba995641dfa (patch)
tree19fcc91d01c48be6db40d2454880bfa993224212
parent943f7f902ed3d7a5ce00bbb5a9cc60e01607b661 (diff)
downloademacs-453af81f16a7eca0bc246c9278d19ba995641dfa.tar.gz
emacs-453af81f16a7eca0bc246c9278d19ba995641dfa.zip
* lisp/mpc.el (mpc-format): Always push form to pred
-rw-r--r--lisp/mpc.el48
1 files changed, 24 insertions, 24 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el
index f83b478e71c..55123ef1d71 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1010,30 +1010,30 @@ If PLAYLIST is t or nil or missing, use the main playlist."
1010 (substring time (match-end 0)) 1010 (substring time (match-end 0))
1011 time))))) 1011 time)))))
1012 (`Cover 1012 (`Cover
1013 (if-let ((dir (file-name-directory 1013 (let ((dir (file-name-directory
1014 (mpc-file-local-copy (cdr (assq 'file info))))) 1014 (mpc-file-local-copy (cdr (assq 'file info))))))
1015 (covers '(".folder.png" "cover.jpg" "folder.jpg")) 1015 ;; (debug)
1016 (cover (cl-loop for file in (directory-files dir) 1016 (push `(equal ',dir (file-name-directory (cdr (assq 'file info)))) pred)
1017 if (member (downcase file) covers) 1017 (if-let ((covers '(".folder.png" "cover.jpg" "folder.jpg"))
1018 return (concat dir file))) 1018 (cover (cl-loop for file in (directory-files dir)
1019 (file (with-demoted-errors "MPC: %s" 1019 if (member (downcase file) covers)
1020 (mpc-file-local-copy cover)))) 1020 return (concat dir file)))
1021 (let (image) 1021 (file (with-demoted-errors "MPC: %s"
1022 ;; (debug) 1022 (mpc-file-local-copy cover))))
1023 (push `(equal ',dir (file-name-directory (cdr (assq 'file info)))) pred) 1023 (let (image)
1024 (if (null size) (setq image (create-image file)) 1024 (if (null size) (setq image (create-image file))
1025 (let ((tempfile (make-temp-file "mpc" nil ".jpg"))) 1025 (let ((tempfile (make-temp-file "mpc" nil ".jpg")))
1026 (call-process "convert" nil nil nil 1026 (call-process "convert" nil nil nil
1027 "-scale" size file tempfile) 1027 "-scale" size file tempfile)
1028 (setq image (create-image tempfile)) 1028 (setq image (create-image tempfile))
1029 (mpc-tempfiles-add image tempfile))) 1029 (mpc-tempfiles-add image tempfile)))
1030 (setq size nil) 1030 (setq size nil)
1031 (propertize dir 'display image)) 1031 (propertize dir 'display image))
1032 ;; Make sure we return something on which we can 1032 ;; Make sure we return something on which we can
1033 ;; place the `mpc-pred' property, as 1033 ;; place the `mpc-pred' property, as
1034 ;; a negative-cache. We could also use 1034 ;; a negative-cache. We could also use
1035 ;; a default cover. 1035 ;; a default cover.
1036 (progn (setq size nil) " "))) 1036 (progn (setq size nil) " "))))
1037 (_ (let ((val (cdr (assq tag info)))) 1037 (_ (let ((val (cdr (assq tag info))))
1038 ;; For Streaming URLs, there's no other info 1038 ;; For Streaming URLs, there's no other info
1039 ;; than the URL in `file'. Pretend it's in `Title'. 1039 ;; than the URL in `file'. Pretend it's in `Title'.