From b70388e1b6cb34165496a768cef73eb85f0d659f Mon Sep 17 00:00:00 2001 From: Tom Cowland Date: Wed, 29 Apr 2020 22:48:59 +0100 Subject: [PATCH] Ignore sidecar dir updates in audio watchers This coordinated access thing is driving me nuts. If access outside the app is not coordinated, we don't get notifications, so we have to be over zealous. But then, we get proper notifications if it is, so being over zealous bites us. Many apps (eg: logic) don't use coordinated access for bounce to disk etc. Hopefuly this fixes #3 (again) without any other bonus side effects. --- Trackomatic/Objects/Project.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Trackomatic/Objects/Project.swift b/Trackomatic/Objects/Project.swift index 448656d..7adedd5 100644 --- a/Trackomatic/Objects/Project.swift +++ b/Trackomatic/Objects/Project.swift @@ -371,6 +371,14 @@ fileprivate class AudioFolderWatcher : NSObject, NSFilePresenter } func presentedSubitemDidChange(at url: URL) { + + guard let p = project else { return; } + + // Ignore anything in our data directory, sometimes this gets called + // for item changes several layers deep if it's done with coordiantion + // (as our saves are). + if url.path.starts( with: p.sidecarDirectory().path ) { return; } + // Force as our mtime might not have changed updateFiles( force: true ); }