forked from mirror/pixelfed
Update Media model, fix thumbnail cdn paths
This commit is contained in:
parent
b8ad594a05
commit
9888af120a
1 changed files with 4 additions and 0 deletions
|
@ -56,6 +56,10 @@ class Media extends Model
|
|||
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 :
|
||||
|
|
Loading…
Add table
Reference in a new issue