From e6759f089f3745a2b1cdf5109a887b95fd1dc6d2 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 25 Mar 2022 16:36:38 +0300 Subject: [PATCH] Albums: fix getAlbumByPhotoId performance issue --- Web/Models/Repositories/Albums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Models/Repositories/Albums.php b/Web/Models/Repositories/Albums.php index 0995a073..99c6c732 100644 --- a/Web/Models/Repositories/Albums.php +++ b/Web/Models/Repositories/Albums.php @@ -119,7 +119,7 @@ class Albums function getAlbumByPhotoId(Photo $photo): ?Album { - $dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch(); + $dbalbum = $this->context->table("album_relations")->where(["media" => $photo->getId()])->fetch(); return $dbalbum->collection ? $this->get($dbalbum->collection) : null; }