check if files are really present in the opus tree

This commit is contained in:
2026-06-30 15:04:23 +02:00
parent 7826f52b25
commit bd4abcaf82
2 changed files with 13 additions and 4 deletions
+7 -3
View File
@@ -72,7 +72,7 @@
(eq? state 'changed)
(eq? state 'new)))))
(define (needs-copying? path info)
(define (needs-copying? path info #:copy [copy 'pure])
(let ((state (hash-ref info 'file-db #f)))
(and (eq? (hash-ref info 'type #f) 'file)
(not (eq? state 'deleted))
@@ -81,7 +81,10 @@
(if (eq? path-part #f)
#f
(if (and (eq? state 'unchanged)
(file-exists? (build-path opus-path path-part)))
(let ((file (if (eq? copy 'pure)
(build-path opus-path path-part)
(path-replace-extension (build-path opus-path path-part) #".opus"))))
(file-exists? file)))
#f
#t)
)
@@ -236,7 +239,8 @@
;; Converteer naar opus indien nodig en flac.
(define (to-opus base-path path info)
(when (and (needs-processing? path info)
(when (and (or (needs-processing? path info)
(needs-copying? path info #:copy 'opus))
(flac? path info))
(let ((path-part (get-path-part info)))
(unless (eq? path-part #f)