aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorYoni Rabkin <yrk@gnu.org>2016-08-01 11:32:01 -0400
committerYoni Rabkin <yrk@gnu.org>2016-08-01 11:32:01 -0400
commit92b982757880ffbe37ef8b2e7d6166c5440d94f0 (patch)
treee18c2dc791e748b0c87e0d1ea482059556165842 /lisp
parentbec63d3ea62dafc4158c35abdf7e9180419a3f78 (diff)
* lisp/emms-tag-editor.el: Avoids FLAC tags dup.
Avoids FLAC tags duplication with old values. Patch by Daniel Dehennin <daniel.dehennin@baby-gnu.org>.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emms-tag-editor.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/emms-tag-editor.el b/lisp/emms-tag-editor.el
index 6ed23f2..23e45f9 100644
--- a/lisp/emms-tag-editor.el
+++ b/lisp/emms-tag-editor.el
@@ -143,19 +143,25 @@ See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'.")
"Commit changes to an FLAC file according to TRACK."
(require 'emms-info-metaflac)
(with-temp-buffer
- (let (need val)
+ (let ((tags '("artist" "composer" "performer" "title" "album" "tracknumber" "discnumber" "date" "genre" "note"))
+ need val)
(mapc (lambda (tag)
(let ((info-tag (intern (concat "info-" tag))))
(when (> (length (setq val (emms-track-get track info-tag))) 0)
(insert (upcase tag) "=" val "\n"))))
- '("artist" "composer" "performer" "title" "album" "tracknumber" "discnumber" "date" "genre" "note"))
+ tags)
(when (buffer-string)
- (funcall #'call-process-region (point-min) (point-max)
- emms-info-metaflac-program-name nil
- (get-buffer-create emms-tag-editor-log-buffer)
- nil
- "--import-tags-from=-"
- (emms-track-name track))))))
+ (apply #'call-process-region (point-min) (point-max)
+ emms-info-metaflac-program-name nil
+ (get-buffer-create emms-tag-editor-log-buffer)
+ nil
+ (append
+ (mapcar (lambda (tag)
+ (concat "--remove-tag=" tag))
+ tags)
+ '("--import-tags-from=-")
+ '("--")
+ (list (emms-track-name track))))))))
(defun emms-tag-editor-tag-ogg (track)
"Commit changes to an OGG file according to TRACK."