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 'changed)
|
||||||
(eq? state 'new)))))
|
(eq? state 'new)))))
|
||||||
|
|
||||||
(define (needs-copying? path info)
|
(define (needs-copying? path info #:copy [copy 'pure])
|
||||||
(let ((state (hash-ref info 'file-db #f)))
|
(let ((state (hash-ref info 'file-db #f)))
|
||||||
(and (eq? (hash-ref info 'type #f) 'file)
|
(and (eq? (hash-ref info 'type #f) 'file)
|
||||||
(not (eq? state 'deleted))
|
(not (eq? state 'deleted))
|
||||||
@@ -81,7 +81,10 @@
|
|||||||
(if (eq? path-part #f)
|
(if (eq? path-part #f)
|
||||||
#f
|
#f
|
||||||
(if (and (eq? state 'unchanged)
|
(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
|
#f
|
||||||
#t)
|
#t)
|
||||||
)
|
)
|
||||||
@@ -236,7 +239,8 @@
|
|||||||
|
|
||||||
;; Converteer naar opus indien nodig en flac.
|
;; Converteer naar opus indien nodig en flac.
|
||||||
(define (to-opus base-path path info)
|
(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))
|
(flac? path info))
|
||||||
(let ((path-part (get-path-part info)))
|
(let ((path-part (get-path-part info)))
|
||||||
(unless (eq? path-part #f)
|
(unless (eq? path-part #f)
|
||||||
|
|||||||
+6
-1
@@ -3,7 +3,12 @@ RKT=/usr/local/bin/racket
|
|||||||
MYNAME=`basename $0`
|
MYNAME=`basename $0`
|
||||||
MYDIR=`echo $0 | sed s/$MYNAME//`
|
MYDIR=`echo $0 | sed s/$MYNAME//`
|
||||||
cd $MYDIR
|
cd $MYDIR
|
||||||
$RKT -e "(enter! \"audio-manager.rkt\") (audio-manager \"/mnt/music\" \"/mnt/music-opus\" #:log-level 'info) (exit)"
|
$RKT -e "(enter! \"audio-manager.rkt\") (audio-manager \"/mnt/music\" \"/data/cloud/hans/files/muziek-opus\" #:log-level 'info) (exit)"
|
||||||
|
|
||||||
|
pushd /data/www/cloud
|
||||||
|
php occ files:scan hans --path="/hans/files/muziek-opus"
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user