fix: sync-music: ensure output file names are valid on Android
This commit is contained in:
parent
1a714ac77a
commit
5f61ca0280
|
@ -84,10 +84,12 @@ Return the action if it exists, or NIL if the file should not be copied."
|
|||
data-raw)
|
||||
:for metadata-filtered := (delete-if (compose #'emptyp #'cdr) metadata)
|
||||
:for previous-action := nil :then current-action
|
||||
:for output-file-name := (substitute #\! #\/ (format nil
|
||||
:for output-file-name := (ppcre:regex-replace-all *invalid-char-scanner*
|
||||
(format nil
|
||||
"~A - ~A"
|
||||
track-number
|
||||
track-title))
|
||||
track-title)
|
||||
"!!!")
|
||||
:for current-action := (make-copy-flac-action
|
||||
:origin origin-file
|
||||
:target (pathname-normalize-unicode
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
(defparameter *timestamp-scanner* (ppcre:create-scanner "^(\\d+):(\\d{2})\\.(\\d{2})$")
|
||||
"Scan for a cuetools position.")
|
||||
|
||||
(defparameter *invalid-char-scanner* (ppcre:create-scanner "[\"*/:<>?\\\\|]")
|
||||
"Scan for any characters not allowed in an Android/NTFS file name.")
|
||||
|
||||
(defun maybe-normalize-unicode (s)
|
||||
(if (stringp s) (uax-15:normalize s :nfc) s))
|
||||
|
||||
|
|
Loading…
Reference in a new issue