On Fri, 06 Aug 2021 18:20:57 -0500 Rodrigo Morales <[email protected]> wrote:
> #+BEGIN_EXAMPLE > (*track* > (type . streamlist) > (name . "http://www.somafm.com/beatblender.pls") > (metadata "SomaFM: Beatblender" "http://www.somafm.com/beatblender.pls" 1 > streamlist)) > #+END_EXAMPLE > > =(emms-playlist-track-at (point))= is able to get the name of the stream > because the file =~/.config/emacs/emms/streams.emms= (which is created by > the function =emms-streams-install=) contains this metadata. > > * The question > > As I shown before in the #+BEGIN_EXAMPLE block, the URL is shown for > each stream in the "Emms Streams" buffer. I am now wondering how I can > show the name (which is stored in the metadata) for each stream in the > playlist buffer. > > I would like to do this because I usually listen to audio streams > using EMMS and having a custom name for each stream would make the > playlist buffer more readable than having the URL. I think something like this might do it: (defun my-emms-track-desc (track) (or (let ((meta (emms-track-get track metadata))) (when meta (car meta))) (emms-track-simple-description track))) (setq emms-track-description-function 'my-emms-track-desc) Idea there is to use first string from the "metadata" attribute that you have attached to the track, if it's there, and otherwise just fallback to default emms-track-simple-description generator. -- Mike Kazantsev // fraggod.net
