From 6bb45c38a967e4b94a925d73599ac44b80484a56 Mon Sep 17 00:00:00 2001 From: James Collins Date: Sun, 28 Apr 2024 18:12:12 +1000 Subject: [PATCH] generic thumbnail for password protected files --- app/Models/Media.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Models/Media.php b/app/Models/Media.php index 1f496e3..7b68a36 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -147,10 +147,12 @@ class Media extends Model */ public function getThumbnailAttribute(): string { - if($this->hasVariant('thumbnail')) { - $url = $this->url('thumbnail', true); - if($url !== '') { - return $url; + if($this->password !== null) { + if ($this->hasVariant('thumbnail')) { + $url = $this->url('thumbnail', true); + if ($url !== '') { + return $url; + } } }