mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update media model, use original photo url for non-existent thumbnails
This commit is contained in:
parent
41ffc71b28
commit
4701b0e8f0
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ class Media extends Model
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) {
|
if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) {
|
||||||
return url(Storage::url($this->media_path));
|
return $this->remote_media || Str::startsWith($this->media_path, 'http') ?
|
||||||
|
$this->media_path :
|
||||||
|
url(Storage::url($this->media_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
return url(Storage::url('public/no-preview.png'));
|
return url(Storage::url('public/no-preview.png'));
|
||||||
|
|
Loading…
Reference in a new issue