From 0e17ef69a9a51262bb94266d9aecc4d583121de5 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 2 Dec 2022 21:11:09 -0800 Subject: [PATCH] preview: increase efficiency --- lib/Controller/ApiBase.php | 9 +++++++-- src/services/FileUtils.ts | 5 ----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Controller/ApiBase.php b/lib/Controller/ApiBase.php index f46db3d0..8101d917 100644 --- a/lib/Controller/ApiBase.php +++ b/lib/Controller/ApiBase.php @@ -155,9 +155,14 @@ class ApiBase extends Controller */ protected function getUserFile(int $fileId): ?File { + // Don't check self for share token + if ($this->getShareToken()) { + return $this->getShareFile($fileId); + } + + // Check both user folder and album return $this->getUserFolderFile($fileId) ?? - $this->getAlbumFile($fileId) ?? - $this->getShareFile($fileId); + $this->getAlbumFile($fileId); } /** diff --git a/src/services/FileUtils.ts b/src/services/FileUtils.ts index e1a3f882..8f086fc4 100644 --- a/src/services/FileUtils.ts +++ b/src/services/FileUtils.ts @@ -148,11 +148,6 @@ const getPreviewUrl = function ( `/apps/memories/api/image/preview/${photo.fileid}?c=${photo.etag}&x=${x}&y=${y}&a=${a}` ); - // Albums from Photos - if (vuerouter.currentRoute.name === "albums") { - url += `&album=1`; - } - // Public preview if (vuerouter.currentRoute.name === "folder-share") { const token = vuerouter.currentRoute.params.token;