feat: add folder button to transcript modal
This commit is contained in:
+2
-2
@@ -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}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user