This commit is contained in:
Kekskurse 2021-01-17 03:06:50 +01:00
parent c41207be87
commit ac515118f5

View file

@ -49,11 +49,9 @@ class PublicController extends BaseController
}
$size = $this->size[$sizeName];
$image = Image::query()->where("id", "=", $image);
$gallery = Gallery::query()->where("id", "=", $gallery);
$tenant = Tenant::query()->where("id", "=", $tenant);
$cacheName = "cache/".$tenant->url."_".$gallery->url."_".$image->id;
$image = Image::query()->where("id", "=", $image)->firstOrFail();
$gallery = Gallery::query()->where("id", "=", $gallery)->firstOrFail();
$tenant = Tenant::query()->where("id", "=", $tenant)->firstOrFail();
if($gallery != $gallery->url) {
abort(404, "Gallery not match");
}
@ -62,6 +60,8 @@ class PublicController extends BaseController
abort(404, "Tenant not match");
}
$cacheName = "cache/".$tenant->url."_".$gallery->url."_".$image->id;
//Check if exsits in cache and return from it
$r = $this->tryReturnFromCache($cacheName."_".$size, $tenant->id, $gallery->id, $image->id);
if($r != null) {