feat: copy transcript to Obsidian vault on open

Config: obsidian.vault path. On Obsidian button click, file is copied to
vault dir then opened via obsidian:// URI. Vault path configurable in settings.
This commit is contained in:
2026-04-02 11:00:55 +02:00
parent 6f718f0753
commit a37e09fb4e
4 changed files with 20 additions and 1 deletions
+9 -1
View File
@@ -216,7 +216,15 @@ async def open_file(body: dict, user: dict = Depends(current_user)):
mode = body.get("mode", "editor") # "editor" | "folder" | "obsidian"
if mode == "obsidian":
from urllib.parse import quote
subprocess.Popen(["xdg-open", f"obsidian://open?path={quote(path, safe='/')}"])
cfg = load_config()
vault = cfg.get("obsidian", {}).get("vault", "").strip()
if vault and os.path.isdir(vault):
dest = os.path.join(vault, os.path.basename(path))
shutil.copy2(path, dest)
target = dest
else:
target = path
subprocess.Popen(["xdg-open", f"obsidian://open?path={quote(target, safe='/')}"])
elif mode == "folder" and shutil.which("dolphin"):
subprocess.Popen(["dolphin", "--select", path])
elif mode == "folder":