aboutsummaryrefslogtreecommitdiff
path: root/emms-tag-editor.el
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2020-11-05 16:41:58 -0500
committerYoni Rabkin <yoni@rabkins.net>2020-11-05 16:41:58 -0500
commit23c895e0ea3f0572f04e8057526bb8f6c12e1948 (patch)
treeed71c5f2b966b851b5ec606390722f91a9d1769a /emms-tag-editor.el
parentdda44f541b70dc6d90acc0e3dd03be5486e9da58 (diff)
* emms-tag-editor.el: Bug fixes for the tag editor.
Patches by Feng Shu <tumashu@163.com>.
Diffstat (limited to 'emms-tag-editor.el')
-rw-r--r--emms-tag-editor.el28
1 files changed, 18 insertions, 10 deletions
diff --git a/emms-tag-editor.el b/emms-tag-editor.el
index ca7941a..f9a9f72 100644
--- a/emms-tag-editor.el
+++ b/emms-tag-editor.el
@@ -40,6 +40,7 @@
(defvar emms-tag-editor-tags
'((info-artist . "a")
+ (info-albumartist . "A")
(info-composer . "C")
(info-performer . "p")
(info-title . "t")
@@ -85,7 +86,7 @@ is the format template. The format specification is like:
m -- Track description
f -- Track name
a -- Track info-artist
- c -- Track info-composer
+ C -- Track info-composer
p -- Track info-performer
t -- Track info-title
l -- Track info-album
@@ -118,13 +119,17 @@ See also `emms-tag-editor-default-parser'.")
(defvar emms-tag-editor-tagfile-functions
'(("mp3" "mid3v2"
- ((info-artist . "a")
- (info-title . "t")
- (info-album . "A")
- (info-tracknumber . "T")
- (info-year . "y")
- (info-genre . "g")
- (info-note . "c")))
+ ((info-artist . "-a")
+ (info-title . "-t")
+ (info-album . "-A")
+ (info-tracknumber . "-T")
+ (info-year . "-y")
+ (info-genre . "-g")
+ (info-note . "-c")
+ (info-albumartist . "--TPE2")
+ (info-composer . "--TCOM")
+ (info-performer . "--TOPE")
+ (info-date . "--TDAT")))
("ogg" . emms-tag-editor-tag-ogg)
("flac" . emms-tag-editor-tag-flac))
"An alist used when committing changes to tags in files.
@@ -316,8 +321,7 @@ changes will only take effect on the tracks in the region."
(if (and mark-active transient-mark-mode)
(narrow-to-region (region-beginning) (region-end)))
(goto-char (point-min))
- (while (re-search-forward (concat "^" (regexp-quote tag)) nil t)
- (skip-chars-forward " \t=")
+ (while (re-search-forward (concat "^" (regexp-quote tag) "[ \t]+=[ \t]+") nil t)
(delete-region (point) (line-end-position))
(insert value)))))
@@ -608,6 +612,10 @@ With prefix argument, bury the tag edit buffer."
(emms-track-get track 'newname))))
(setq filename (emms-track-get track 'newname))
(ignore-errors
+ ;; if `emms-tag-editor-rename-format' is like "%a/%l/%t",
+ ;; we may need to create directory first.
+ (let ((dir (file-name-directory filename)))
+ (when dir (make-directory dir t)))
;; Ignore errors so that renaming multiple files doesn't stop
;; because of one that fails. In that case it's probably
;; old-file = newfile which causes the problem.