Discussion:
[emms-help] [PATCH] Avoids FLAC tags duplication with old values.
Daniel Dehennin
2016-07-22 23:00:46 UTC
Permalink
The following changes since commit bec63d3ea62dafc4158c35abdf7e9180419a3f78:

* Makefile: add .info suffix. (2016-07-09 12:33:04 -0400)

are available in the git repository at:

git://git.baby-gnu.net/emms.git tags/hotfix/duplicated-flac-tags

for you to fetch changes up to d392fcd18b79b50daa03b9849c18424fc77cc7ff:

emms-tag-editor-tag-flac do not replace tags (2016-07-22 23:43:02 +0200)

----------------------------------------------------------------
Avoids FLAC tags duplication with old values.

----------------------------------------------------------------
Daniel Dehennin (1):
emms-tag-editor-tag-flac do not replace tags

lisp/emms-tag-editor.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/lisp/emms-tag-editor.el b/lisp/emms-tag-editor.el
index 6ed23f2..c1d4b9d 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."
--
Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF
Yoni Rabkin
2016-08-01 15:33:49 UTC
Permalink
commited

Loading...