From b5cf80e98160059110e90330688491c4ce99dd94 Mon Sep 17 00:00:00 2001 From: Warren Date: Sun, 17 May 2026 05:34:40 +0800 Subject: [PATCH] fix: Add user_id to photo navigation arrows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Left/right arrows for photo navigation showed 'No preview' - navigatePhoto() missing user_id parameter in stream API call - img.src used old format: /api/v2/files/{file_uuid}/stream Solution: - Modified navigatePhoto() to include user_id - Changed to: /api/v2/files/{user_id}/{file_uuid}/stream - Get user_id from localStorage (tree_user) Result: - Photo navigation arrows now work correctly ✅ - Can browse through jpg/png/gif images in detail panel ✅ - Position indicator (1/2371) shows correct count ✅ Files: - src/page.html (navigatePhoto function) --- data/auth.sqlite | Bin 73728 -> 73728 bytes src/page.html | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/data/auth.sqlite b/data/auth.sqlite index c135a487c56da5a76181e7805587d04dbea551d3..6c03a00d900a411ef16aed87a240a3f48f33434e 100644 GIT binary patch delta 183 zcmZoTz|wGlWr8$g>_i!7#@LMsQ)L+)C;Q7TVte$qQK8Xk@;tfutZy5Q8l5LQ$!}zQ zyZMX!bAHJ~yv(vpx%s)Nc_l@a3Ek(!$AfH7BB;+ usQ)Q`pk@2xO+eya~wM`2Rr8<}dk%{Xj9b|7SsB|3PBgzwk5u=jXL&Kmq{M6gsv5 diff --git a/src/page.html b/src/page.html index 15bc3cb..c7db741 100644 --- a/src/page.html +++ b/src/page.html @@ -877,12 +877,13 @@ function updatePhotoPos(fuuid){ } function navigatePhoto(dir){ + var userId=localStorage.getItem("tree_user")||"demo"; var idx=_photoList.indexOf(_photoUuid); if(dir=="prev"&&idx>0)idx--;else if(dir=="next"&&idx<_photoList.length-1)idx++; if(idx>=0&&idx<_photoList.length){ _photoUuid=_photoList[idx]; var img=document.getElementById("mb-preview-img"); - if(img)img.src="/api/v2/files/"+_photoUuid+"/stream?_="+Date.now(); + if(img)img.src="/api/v2/files/"+userId+"/"+_photoUuid+"/stream?_="+Date.now(); updatePhotoPos(_photoUuid); } }