feat: add folder button to transcript modal

This commit is contained in:
2026-04-02 10:47:08 +02:00
parent 7e0851fc95
commit 348ce332c7
3 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -210,10 +210,10 @@ async def put_config(body: dict, user: dict = Depends(current_user)):
async def open_file(body: dict, user: dict = Depends(current_user)):
import subprocess
path = body.get("path", "")
# Only allow opening files within the user's own output directory
user_dir = os.path.join(user["output_dir"], user["username"])
if path and os.path.exists(path) and os.path.abspath(path).startswith(os.path.abspath(user_dir)):
subprocess.Popen(["xdg-open", path])
target = os.path.dirname(path) if body.get("folder") else path
subprocess.Popen(["xdg-open", target])
return {"ok": True}