unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Search for more cover image names in MPC
@ 2015-10-11 15:18 Mark Oteiza
  0 siblings, 0 replies; only message in thread
From: Mark Oteiza @ 2015-10-11 15:18 UTC (permalink / raw)
  To: emacs-devel


* lisp/mpc.el (mpc-format): Also look for .folder.jpg or folder.jpg
case insensitively
---

The downcase isn't necessary, I just thought it would be nice to allow
things cased differently. At least in my library, I seem to have a
handful of capitalized folder images.

 lisp/mpc.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/mpc.el b/lisp/mpc.el
index bc7d473..0178712 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.
@@ -1010,7 +1009,11 @@ If PLAYLIST is t or nil or missing, use the main playlist."
                                              time)))))
                     (`Cover
                      (let* ((dir (file-name-directory (cdr (assq 'file info))))
-                            (cover (concat dir "cover.jpg"))
+                            (covers '(".folder.png" "cover.jpg" "folder.jpg"))
+                            (cover (cl-flet ((coverp (fn)
+                                               (member (downcase fn) covers)))
+                                     (cl-loop for file in (directory-files dir)
+                                              if (coverp file) return file)))
                             (file (with-demoted-errors "MPC: %s"
                                     (mpc-file-local-copy cover)))
                             image)
-- 
2.6.1





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-11 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 15:18 [PATCH] Search for more cover image names in MPC Mark Oteiza

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).