diff --git a/sync-music/actions.lisp b/sync-music/actions.lisp index af3e343..81cec53 100644 --- a/sync-music/actions.lisp +++ b/sync-music/actions.lisp @@ -53,19 +53,10 @@ Pushes status message about this action to QUEUE if given.")) (defmethod action-perform ((a copy-meta-action) &optional queue) (declare (ignore queue)) - (let (buf) - (with-open-file (input - (copy-action-origin a) - :element-type 'octet) - (setf buf (make-array (file-length input) :element-type 'octet)) - (read-sequence buf input)) + (let ((buf (read-file-into-byte-vector (copy-action-origin a)))) (setf buf (replace-text-buffer buf ".flac\"" ".opus\"")) (setf buf (replace-text-buffer buf ".wav\"" ".opus\"")) - (with-open-file (output - (action-target a) - :element-type 'octet - :direction :output) - (write-sequence buf output)))) + (write-byte-vector-into-file buf (action-target a)))) (defmethod action-perform ((a delete-action) &optional queue) (declare (ignore queue))