emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0f4efd1: Search for more cover image names in MPC


From: Mark Oteiza
Subject: [Emacs-diffs] master 0f4efd1: Search for more cover image names in MPC
Date: Mon, 12 Oct 2015 20:32:54 +0000

branch: master
commit 0f4efd12209607b54371868141064c12b7f021e9
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    Search for more cover image names in MPC
    
    * lisp/mpc.el (mpc-format): Also look for .folder.jpg or folder.jpg
    case insensitively
---
 lisp/mpc.el |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/mpc.el b/lisp/mpc.el
index bc7d473..6e69b6f 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -44,7 +44,6 @@
 ;; - visual feedback for drag'n'drop
 ;; - display/set `repeat' and `random' state (and maybe also `crossfade').
 ;; - allow multiple *mpc* sessions in the same Emacs to control different mpds.
-;; - look for .folder.png (freedesktop) or folder.jpg (XP) as well.
 ;; - fetch album covers and lyrics from the web?
 ;; - improve MPC-Status: better volume control, add a way to show/hide the
 ;;   rest, plus add the buttons currently in the toolbar.
@@ -1009,8 +1008,12 @@ If PLAYLIST is t or nil or missing, use the main 
playlist."
                                                (substring time (match-end 0))
                                              time)))))
                     (`Cover
-                     (let* ((dir (file-name-directory (cdr (assq 'file info))))
-                            (cover (concat dir "cover.jpg"))
+                     (let* ((dir (file-name-directory
+                                  (mpc-file-local-copy (cdr (assq 'file 
info)))))
+                            (covers '(".folder.png" "cover.jpg" "folder.jpg"))
+                            (cover (cl-loop for file in (directory-files dir)
+                                            if (member (downcase file) covers)
+                                            return (concat dir file)))
                             (file (with-demoted-errors "MPC: %s"
                                     (mpc-file-local-copy cover)))
                             image)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]