Album URL now uses the Photo's thumbnailUrl method - allowing for cache-busting on the main gallery index
This commit is contained in:
parent
44591790d1
commit
bfd7a8100d
@ -203,8 +203,6 @@ class Album extends Model
|
|||||||
return $this->hasMany(Photo::class);
|
return $this->hasMany(Photo::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function redirects()
|
public function redirects()
|
||||||
{
|
{
|
||||||
return $this->hasMany(AlbumRedirect::class);
|
return $this->hasMany(AlbumRedirect::class);
|
||||||
@ -217,13 +215,14 @@ class Album extends Model
|
|||||||
|
|
||||||
public function thumbnailUrl($thumbnailName)
|
public function thumbnailUrl($thumbnailName)
|
||||||
{
|
{
|
||||||
|
/** @var Photo $photo */
|
||||||
$photo = $this->photos()
|
$photo = $this->photos()
|
||||||
->inRandomOrder()
|
->inRandomOrder()
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (!is_null($photo))
|
if (!is_null($photo))
|
||||||
{
|
{
|
||||||
return $this->getAlbumSource()->getUrlToPhoto($photo, $thumbnailName);
|
return $photo->thumbnailUrl($thumbnailName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if any child albums have an image
|
// See if any child albums have an image
|
||||||
|
Loading…
Reference in New Issue
Block a user