[Music] Simplify implementation of ‘db/play-playlist-from-cache’
Use ‘db/-emms-playlist-from-files’ instead of generating the playlist on our own.
This commit is contained in:
parent
68d7605deb
commit
bd29ca9c02
@ -29,21 +29,11 @@ Shuffle it and start playing it afterwards."
|
|||||||
(defun db/play-playlist-from-cache ()
|
(defun db/play-playlist-from-cache ()
|
||||||
"Start playing songs from `db/playlist’"
|
"Start playing songs from `db/playlist’"
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-window-excursion
|
(db/-emms-playlist-from-files
|
||||||
(let ((music-buffer-name "*EMMS Playlist* -- Personal"))
|
(->> db/playlist
|
||||||
(unless (get-buffer music-buffer-name)
|
(cl-remove-if-not #'(lambda (track)
|
||||||
(emms-playlist-new music-buffer-name))
|
(eq (cdr track) :include)))
|
||||||
(with-current-buffer (get-buffer music-buffer-name)
|
(mapcar #'car))))
|
||||||
(emms-stop)
|
|
||||||
(emms-playlist-set-playlist-buffer)
|
|
||||||
(emms-playlist-current-clear)
|
|
||||||
(dolist (track db/playlist)
|
|
||||||
(when (eq :include (cdr track))
|
|
||||||
(emms-playlist-current-insert-source 'emms-insert-file (car track))))
|
|
||||||
(goto-char (point-min))
|
|
||||||
(emms-shuffle)
|
|
||||||
(emms-playlist-select-first)
|
|
||||||
(emms-start)))))
|
|
||||||
|
|
||||||
(defun db/play-playlist-from-git-annex-tag (match-expression)
|
(defun db/play-playlist-from-git-annex-tag (match-expression)
|
||||||
"Generate playlist from git annex find on MATCH-EXPRESSION.
|
"Generate playlist from git annex find on MATCH-EXPRESSION.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user