From c4869f5652a9e2d0ff6a32f2bc1b56dea420fbbb Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 2 Jul 2026 14:32:41 +0200 Subject: [PATCH] Reset file info for administrating changes, to prevent audio manager processing files twice that are essentially unchanged. --- audio-manager.rkt | 7 +++---- private/file-walker.rkt | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/audio-manager.rkt b/audio-manager.rkt index 9bce9d3..8160fd0 100644 --- a/audio-manager.rkt +++ b/audio-manager.rkt @@ -192,8 +192,7 @@ (if (convert-flac-to-rate path base-rate) (begin (hash-set! info 'khz base-rate) - (hash-set! info 'size (file-size path)) - (hash-set! info 'mtime (file-or-directory-modify-seconds path)) + (reset-file-admin-info path info) ) (begin (err-am " Cannot convert!") @@ -225,8 +224,7 @@ (tags-picture! tags cover) (tags-save! tags)) #:mode 'read-write)) - (hash-set! info 'size (file-size path)) - (hash-set! info 'mtime (file-or-directory-modify-seconds path)) + (reset-file-admin-info path info) (info-am " Picture set") (set! pictures-set (+ pictures-set 1)) ) @@ -273,6 +271,7 @@ (if (convert-to-opus path opus-file ini) (begin (set! converted-files (+ converted-files 1)) + (reset-file-admin-info path info) (info-am " Converted ~a, job-nr = ~a" converted-files jobnr) ) (begin diff --git a/private/file-walker.rkt b/private/file-walker.rkt index 1a9663c..567a99c 100644 --- a/private/file-walker.rkt +++ b/private/file-walker.rkt @@ -11,6 +11,7 @@ (provide make-file-walker make-file-admin + reset-file-admin-info fw-add-step os-path ) @@ -102,6 +103,13 @@ ) )) +(define (reset-file-admin-info path info) + (when (eq? (hash-ref info 'type #f) 'file) + (hash-set! info 'size (file-size path)) + (hash-set! info 'mtime (file-or-directory-modify-seconds path)) + ) + ) + (define (make-file-admin base-path db-store #:filename-cleaner [fc-f (λ (f) f)]) (define (file-info-equal? i1 i2)