From fc06f5e36aac225952c1833def82f890b7c9504b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Wed, 14 Jan 2026 12:23:31 +0100 Subject: [PATCH] Enhance editor logging for file sessions in routes and update video URL handling in file explorer --- b0esche_cloud/lib/pages/file_explorer.dart | 10 +++++----- go_cloud/internal/http/routes.go | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/b0esche_cloud/lib/pages/file_explorer.dart b/b0esche_cloud/lib/pages/file_explorer.dart index 9d965d5..bd62acf 100644 --- a/b0esche_cloud/lib/pages/file_explorer.dart +++ b/b0esche_cloud/lib/pages/file_explorer.dart @@ -1411,11 +1411,11 @@ class _FileExplorerState extends State { return GestureDetector( onTap: () async { final videoUrl = await getIt() - .getFileUrl( - orgId: widget.orgId, - fileId: file.id ?? '', - ); - _showVideoViewer(file.name, videoUrl); + .getDownloadUrl(widget.orgId, file.path); + _showVideoViewer( + file.name, + '${getIt().baseUrl}$videoUrl', + ); }, child: _buildFileItem( file, diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index 7606ddb..ca47277 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -685,6 +685,8 @@ func editorHandler(w http.ResponseWriter, r *http.Request, db *database.DB, audi orgID := r.Context().Value(middleware.OrgKey).(uuid.UUID) fileId := chi.URLParam(r, "fileId") + fmt.Printf("[EDITOR] Starting editor session for file=%s user=%s org=%s\n", fileId, userIDStr, orgID.String()) + // Log activity db.LogActivity(r.Context(), userID, orgID, &fileId, "edit_file", map[string]interface{}{}) @@ -722,6 +724,8 @@ func userEditorHandler(w http.ResponseWriter, r *http.Request, db *database.DB, userID, _ := uuid.Parse(userIDStr) fileId := chi.URLParam(r, "fileId") + fmt.Printf("[EDITOR] Starting user editor session for file=%s user=%s\n", fileId, userIDStr) + // Get file metadata to determine path and type fileUUID, err := uuid.Parse(fileId) if err != nil { @@ -754,6 +758,8 @@ func userEditorHandler(w http.ResponseWriter, r *http.Request, db *database.DB, // Build Collabora editor URL collaboraUrl := fmt.Sprintf("https://of.b0esche.cloud/lool/dist/mobile/cool.html?WOPISrc=%s", url.QueryEscape(wopiSrc)) + fmt.Printf("[EDITOR] Built user URLs: wopiSrc=%s collaboraUrl=%s\n", wopiSrc, collaboraUrl) + // Check if user can edit (for now, all users can edit their own files) readOnly := false