emms-help
[Top][All Lists]
Advanced

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

[emms-help] [patch] Browser: look for covers only when displaying albums


From: Cédric Chépied
Subject: [emms-help] [patch] Browser: look for covers only when displaying albums
Date: Thu, 30 Mar 2017 15:05:23 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi,

I'm using a sshfs music directory with an poor 6 Mb/s connection. When I open
the browser (by genre for example) it takes several minutes to display all my
collection because it is looking for covers for each element.

I made this patch so the browser looks for covers only when it is displaying an
album item and so my emacs is not stuck when I want to listen some music.

Regards,
-- 
Cédric Chépied
<address@hidden>


>From c125f7f52db0597485e30fc4546703985cfd649c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Ch=C3=A9pied?= <address@hidden>
Date: Thu, 30 Mar 2017 14:29:57 +0200
Subject: [PATCH] Browser: look for covers only when displaying albums

---
 lisp/emms-browser.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el
index 23b1495..ad6b326 100644
--- a/lisp/emms-browser.el
+++ b/lisp/emms-browser.el
@@ -1751,13 +1751,17 @@ If > album level, most of the track data will not make 
sense."
             ("C" . ,(emms-track-get track 'info-composer))
             ("p" . ,(emms-track-get track 'info-performer))
             ("t" . ,(emms-track-get track 'info-title))
-           ("D" . ,(emms-browser-disc-number track))
+            ("D" . ,(emms-browser-disc-number track))
             ("T" . ,(emms-browser-track-number track))
-            ("d" . ,(emms-browser-track-duration track))
-            ("cS" . ,(emms-browser-get-cover-str path 'small))
-            ("cM" . ,(emms-browser-get-cover-str path 'medium))
-            ("cL" . ,(emms-browser-get-cover-str path 'large))))
-         str)
+            ("d" . ,(emms-browser-track-duration track))))
+            str)
+
+    (when (equal type 'info-album)
+      (setq format-choices (append format-choices
+                                   `(("cS" . ,(emms-browser-get-cover-str path 
'small))
+                                     ("cM" . ,(emms-browser-get-cover-str path 
'medium))
+                                     ("cL" . ,(emms-browser-get-cover-str path 
'large))))))
+
 
     (when (functionp format)
       (setq format (funcall format bdata format-choices)))
-- 
2.12.1



reply via email to

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