Skip to content

Route detected calls to a folder per app - #23

Merged
TerrifiedBug merged 1 commit into
mainfrom
feat/recording-routes
Sep 7, 2026
Merged

Route detected calls to a folder per app#23
TerrifiedBug merged 1 commit into
mainfrom
feat/recording-routes

Conversation

@TerrifiedBug

Copy link
Copy Markdown
Owner

What

recording_routes in config.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 under recordings_dir. Manual menu-bar sessions and unlisted apps still go to recordings_dir. A route the disk cannot honour falls back to the root with a logged warning. meta.json gains "app" for routed sessions.

recordings_dir is 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)

  • Backfill of an existing config: "recording_routes": {}, lands directly under recordings_dir; diff against the original is that one line.
  • UI: add via + (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.
  • Detected call (QuickTime audio recording as the mic holder): ● recording → ~/Desktop/yap-route-test/…, "app" : "com.apple.QuickTimePlayerX" in meta.json, transcript written there, title rename stays in the route folder.
  • Relative "work"<recordings_dir>/work/….
  • /Volumes/nope/xroute: cannot create /Volumes/nope/x for com.apple.QuickTimePlayerX — using recordings_dir, session under the root.
  • Manual session with a route present → root, no "app" key.
  • transcript.json deleted from the routed session, restart → resuming 1 untranscribed session(s), transcript rewritten in the route folder.
  • recordings_dir changed while running: no restart line; next manual session lands in the new folder.

Latency

Transcription is untouched. yap bench --audio on 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.md section — those travel with the release cut, as in #22.

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.
@TerrifiedBug
TerrifiedBug merged commit d8c9be0 into main Sep 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant