MCPcopy Index your code
hub / github.com/CapSoftware/Cap / importRecordingPath

Function importRecordingPath

apps/desktop/src/routes/editor/ClipsSidebar.tsx:485–505  ·  view source on GitHub ↗
(sourcePath: string)

Source from the content-addressed store, hash-verified

483 };
484
485 const importRecordingPath = async (sourcePath: string) => {
486 if (importing()) return;
487 setImporting(true);
488 const toastId = toast.loading("Importing clip…");
489 try {
490 if (editorState.playing) {
491 await commands.stopPlayback();
492 setEditorState("playing", false);
493 }
494 await commands.setProjectConfig(serializeProjectConfiguration(project));
495 const count = await commands.addExistingRecordingToEditor(sourcePath);
496 toast.success(count === 1 ? "Clip imported" : `${count} clips imported`, {
497 id: toastId,
498 });
499 window.location.reload();
500 } catch (error) {
501 const message = error instanceof Error ? error.message : String(error);
502 toast.error(`Failed to import clip: ${message}`, { id: toastId });
503 setImporting(false);
504 }
505 };
506
507 const pickMp4 = async () => {
508 const path = await open({

Callers 2

pickMp4Function · 0.85
pickCapRecordingFunction · 0.85

Calls 1

Tested by

no test coverage detected