aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-01-29 15:46:00 +0000
committerMichael Olson <mwolson@gnu.org>2007-01-29 15:46:00 +0000
commit687746e80c5bd91cd87e62ff307386b52274fc43 (patch)
treee9102c1ae18890900abb5e8ebce5d8d1a3aa9cf9
parent0a349ff083fd9d426a3bcfa1b23ceb5b66d40f0f (diff)
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
-rw-r--r--emms-tag-editor.el21
1 files 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