Discussion:
[emms-help] [patch] Browser: look for covers only when displaying albums
Cédric Chépied
2017-03-30 13:05:23 UTC
Permalink
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
<***@gmail.com>


From c125f7f52db0597485e30fc4546703985cfd649c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Ch=C3=A9pied?= <***@gmail.com>
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
Yoni Rabkin
2017-03-30 17:36:31 UTC
Permalink
Post by Cédric Chépied
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.
This looks like a good change. I don't use the browser so I haven't hit
this issue. Thank you for the patch.

Rasmus, does this patch make sense to you? Someone who uses the browser
should weigh-in before it gets installed.
Post by Cédric Chépied
Regards,
--
Cédric Chépied
Post by Cédric Chépied
From c125f7f52db0597485e30fc4546703985cfd649c Mon Sep 17 00:00:00 2001
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)))
--
"Cut your own wood and it will warm you twice"
Rasmus Pank Roulund
2017-04-11 08:43:03 UTC
Permalink
Post by Yoni Rabkin
Post by Cédric Chépied
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.
This looks like a good change. I don't use the browser so I haven't hit
this issue. Thank you for the patch.
Rasmus, does this patch make sense to you? Someone who uses the browser
should weigh-in before it gets installed.
It looks good to me. Thanks Cédric!
--
The right to be left alone is a human right
Yoni Rabkin
2017-04-17 20:48:56 UTC
Permalink
Post by Rasmus Pank Roulund
Post by Yoni Rabkin
Post by Cédric Chépied
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.
This looks like a good change. I don't use the browser so I haven't hit
this issue. Thank you for the patch.
Rasmus, does this patch make sense to you? Someone who uses the browser
should weigh-in before it gets installed.
It looks good to me. Thanks Cédric!
Certainly took my time didn't I? Sorry about that. I commited the
change.

Thank you Cédric.
--
"Cut your own wood and it will warm you twice"
Loading...