Skip to content

Commit

Permalink
Update Media model, fix thumbnail cdn paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Oct 3, 2022
1 parent b8ad594 commit 9888af1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function thumbnailUrl()
return url(Storage::url($this->thumbnail_path));
}

if($this->remote_media && !$this->thumbnail_path && $this->cdn_url) {
return $this->cdn_url;
}

if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) {
return $this->remote_media || Str::startsWith($this->media_path, 'http') ?
$this->media_path :
Expand Down

0 comments on commit 9888af1

Please sign in to comment.