From 687746e80c5bd91cd87e62ff307386b52274fc43 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 29 Jan 2007 15:46:00 +0000 Subject: emms-tag-editor: Make editing of ogg vorbis comments work properly It turns out we have to have the "-t" option before each bit of track information, not just the first. Also, avoid sending empty track information to vorbiscomment. darcs-hash:20070129154657-1bfb2-a8266b299f4c9eee6db666b1ff71a04c3aa48076.gz --- emms-tag-editor.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/emms-tag-editor.el b/emms-tag-editor.el index 5bfb3ee..0bb6bdd 100644 --- a/emms-tag-editor.el +++ b/emms-tag-editor.el @@ -122,22 +122,23 @@ See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'. ") (defun emms-tag-editor-tag-ogg (track) - (call-process "vorbiscomment" nil nil nil - "-w" "-t" - (mapconcat - (lambda (tag) - (concat tag "=" - (emms-track-get track (intern (concat "info-" tag))))) - '("artist" "title" "album" "tracknumber" "date" "genre" "note") - "\n\t") - (emms-track-name track))) + (let (args val) + (mapc (lambda (tag) + (let ((info-tag (intern (concat "info-" tag)))) + (when (> (length (setq val (emms-track-get track info-tag))) 0) + (setq args (append (list "-t" (concat tag "=" val)) args))))) + '("artist" "title" "album" "tracknumber" "date" "genre" "note")) + (when args + (apply #'call-process "vorbiscomment" nil nil nil + "-w" + (append args (list (emms-track-name track))))))) (defun emms-tag-editor-tag-file (track program tags) "Change tag in FILE use PROGRAM. The TAGS is given in `emms-tag-editor-tagfile-functions'." (let (args val) (mapc (lambda (tag) (when (> (length (setq val (emms-track-get track (car tag)))) 0) - (setq args (append args (list (concat "-" (cdr tag)) val))))) + (setq args (append (list (concat "-" (cdr tag)) val) args)))) tags) (apply 'call-process program nil nil nil -- cgit v1.2.3