Route detected calls to a folder per app - #23
Merged
Conversation
Every recorded session landed under `recordings_dir`, so a Zoom call and a
FaceTime call sat side by side in the same folder. `recording_routes` maps a
bundle id to a folder: a value is `~`-expanded, a relative one sits under
the root. Only a session yap starts from a detected call is routed — one
started from the menu bar, or a call from an app not listed, still goes to
the root. A route the disk cannot honour (an unmounted volume) falls back
to the root with a logged warning rather than costing the call, and
`meta.json` records the app so the folder can say why it is where it is.
The daemon no longer captures the root at boot. It resolves the
destination at each session start, which routing needs anyway, so
`recordings_dir` now changes on the spot like everything else and the
restart warning for it goes. Resume scans the root and every route folder,
each once, so a route pointing back at the root cannot queue a session
twice.
Settings gains a "Route by app" list under Recordings, the same control as
the ignored-apps list with the folder as the subtitle: + picks the app then
its folder, − removes, double-click changes the folder. The two lists share
one view and one pair of pickers.
Backfill now puts a new key where the template lists it — under the
nearest earlier key the file already has — instead of at the top of the
file. Only a line that ends in a comma can anchor one, so a value spread
over lines is never spliced into, and an empty object is written as `{}`
rather than Foundation's three-line rendering of it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
recording_routesinconfig.json: a map from bundle id to folder, so a call detected from Zoom lands in a work folder and one from FaceTime in a personal one.~is expanded; a relative value sits underrecordings_dir. Manual menu-bar sessions and unlisted apps still go torecordings_dir. A route the disk cannot honour falls back to the root with a logged warning.meta.jsongains"app"for routed sessions.recordings_diris now hot: the daemon resolves the destination at each session start instead of capturing a root at boot, and the restart warning for it is gone. Resume scans the root plus every route folder, deduplicated.Settings → Recordings gains a "Route by app" list (same control as the ignored-apps list, generalised):
+picks the app then the folder,−removes, double-click changes the folder.Backfill now inserts a new key under the nearest earlier template key the file already has rather than at the top of the file, anchoring only on single-line values so a spread-out object or array is never spliced into. An empty object is written as
{}.Verified live (dev build, M4)
"recording_routes": {},lands directly underrecordings_dir; diff against the original is that one line.+(Photo Booth →~/Desktop/yap-route-test) writes{ "com.apple.PhotoBooth": "~/Desktop/yap-route-test" }on one line; double-click on the row opens the folder picker and updates subtitle and config;−empties the map.● recording → ~/Desktop/yap-route-test/…,"app" : "com.apple.QuickTimePlayerX"inmeta.json, transcript written there, title rename stays in the route folder."work"→<recordings_dir>/work/…./Volumes/nope/x→route: cannot create /Volumes/nope/x for com.apple.QuickTimePlayerX — using recordings_dir, session under the root."app"key.transcript.jsondeleted from the routed session, restart →resuming 1 untranscribed session(s), transcript rewritten in the route folder.recordings_dirchanged while running: no restart line; next manual session lands in the new folder.Latency
Transcription is untouched.
yap bench --audioon a 6.3 s clip,parakeet-tdt-ctc-110m, p50: 45 ms before, 46 ms after.Tests
ConfigBackfillTests: placement under the template predecessor, two missing neighbours in order, nested-section placement, multi-line predecessor fallback. Each fails with the anchor disabled.swift test: 52 passed.Not in this PR
No version bump or
CHANGELOG.mdsection — those travel with the release cut, as in #22.