When an audio file's artist or album info contains '/', 
emms-tag-editor-rename-track will have wrong behaviors. I wrote this patch to 
fix it.

Let's suppose an audio "test.mp3" which artist is "Alice/Bob", when I call 
emms-tag-editor-rename-track to rename it to {artist - track}, emms will regard 
"Alice/Bob - test.mp3" as a directory called "Alice" and its file "Bob - 
test.mp3", instead of rename the file correctly. If we replace '/' with '_', 
then the rename function will work.
From 9579578828a28bf1238da10f4c8f9c06085fc740 Mon Sep 17 00:00:00 2001
From: teeoius <teeo...@proton.me>
Date: Wed, 16 Jul 2025 15:34:46 +0000
Subject: [PATCH] Fix emms-tag-editor-rename-track to support slash in newname

---
 emms-tag-editor.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emms-tag-editor.el b/emms-tag-editor.el
index 401bca7..e5050a1 100644
--- a/emms-tag-editor.el
+++ b/emms-tag-editor.el
@@ -795,8 +795,8 @@ Then it's the callers job to apply them afterwards with
                                        (mapcar
                                         (lambda (tag)
                                           (list (string-to-char (cdr tag))
-                                                (or (emms-track-get track (car tag))
-                                                    "")))
+                                                (string-replace "/" "_"  (or (emms-track-get track (car tag))
+                                                                             ""))))
                                         emms-tag-editor-tags))))
 			"." suffix)))
         (emms-track-set track 'newname new-file)
-- 
2.50.1

Reply via email to