feat: sync-music: ensure valid file name on all files
This commit is contained in:
parent
055b9252d3
commit
8bfea36345
|
@ -19,7 +19,9 @@ if the file should not be copied."
|
||||||
(funcall make-action-fn
|
(funcall make-action-fn
|
||||||
:origin origin
|
:origin origin
|
||||||
:target (pathname-normalize-unicode
|
:target (pathname-normalize-unicode
|
||||||
(make-pathname :name (pathname-name origin)
|
(make-pathname :name (ensure-valid-file-name
|
||||||
|
(pathname-name
|
||||||
|
origin))
|
||||||
:type (string-downcase type)
|
:type (string-downcase type)
|
||||||
:defaults target)))))
|
:defaults target)))))
|
||||||
|
|
||||||
|
@ -102,10 +104,8 @@ extension equality."
|
||||||
:for output-file-name := (format nil
|
:for output-file-name := (format nil
|
||||||
"~A - ~A"
|
"~A - ~A"
|
||||||
track-number-str
|
track-number-str
|
||||||
(ppcre:regex-replace-all
|
(ensure-valid-file-name
|
||||||
*invalid-char-scanner*
|
track-title))
|
||||||
track-title
|
|
||||||
"!!!"))
|
|
||||||
:for current-action := (make-copy-flac-action
|
:for current-action := (make-copy-flac-action
|
||||||
:origin origin-file
|
:origin origin-file
|
||||||
:target (pathname-normalize-unicode
|
:target (pathname-normalize-unicode
|
||||||
|
|
|
@ -36,6 +36,10 @@
|
||||||
:type (maybe-normalize-unicode (pathname-type p))
|
:type (maybe-normalize-unicode (pathname-type p))
|
||||||
:defaults p))
|
:defaults p))
|
||||||
|
|
||||||
|
(defun ensure-valid-file-name (s)
|
||||||
|
"Make sure that STRING is a valid file name on Android/NTFS."
|
||||||
|
(ppcre:regex-replace-all *invalid-char-scanner* s "!!!"))
|
||||||
|
|
||||||
(defmacro handle-overflow ((unit unit-max) (next-unit &optional next-max) &rest args)
|
(defmacro handle-overflow ((unit unit-max) (next-unit &optional next-max) &rest args)
|
||||||
"Handle integer overflow from UNIT with maximum UNIT-MAX into NEXT-UNIT."
|
"Handle integer overflow from UNIT with maximum UNIT-MAX into NEXT-UNIT."
|
||||||
(with-gensyms (div rem)
|
(with-gensyms (div rem)
|
||||||
|
|
Loading…
Reference in a new issue