preview: increase efficiency

cap
Varun Patil 2022-12-02 21:11:09 -08:00
parent db125b5298
commit 0e17ef69a9
2 changed files with 7 additions and 7 deletions

View File

@ -155,9 +155,14 @@ class ApiBase extends Controller
*/ */
protected function getUserFile(int $fileId): ?File 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) ?? return $this->getUserFolderFile($fileId) ??
$this->getAlbumFile($fileId) ?? $this->getAlbumFile($fileId);
$this->getShareFile($fileId);
} }
/** /**

View File

@ -148,11 +148,6 @@ const getPreviewUrl = function (
`/apps/memories/api/image/preview/${photo.fileid}?c=${photo.etag}&x=${x}&y=${y}&a=${a}` `/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 // Public preview
if (vuerouter.currentRoute.name === "folder-share") { if (vuerouter.currentRoute.name === "folder-share") {
const token = vuerouter.currentRoute.params.token; const token = vuerouter.currentRoute.params.token;