check if files are really present in the opus tree
This commit is contained in:
+7
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user