forked from mirror/pixelfed
Update media model, use original photo url for non-existent thumbnails
This commit is contained in:
parent
2533bd51a9
commit
9b04b9d897
|
@ -55,6 +55,10 @@ class Media extends Model
|
||||||
return url(Storage::url($this->thumbnail_path));
|
return url(Storage::url($this->thumbnail_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->media_path && $this->mime && in_array($this->mime, ['image/jpeg', 'image/png'])) {
|
||||||
|
return 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 New Issue