mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Status model, add cache busting to unprocessed media urls
This commit is contained in:
parent
85d164ce07
commit
8194432073
1 changed files with 4 additions and 2 deletions
|
@ -42,8 +42,10 @@ class Status extends Model
|
||||||
|
|
||||||
public function mediaUrl()
|
public function mediaUrl()
|
||||||
{
|
{
|
||||||
$path = $this->firstMedia()->media_path;
|
$media = $this->firstMedia();
|
||||||
$url = Storage::url($path);
|
$path = $media->media_path;
|
||||||
|
$hash = is_null($media->processed_at) ? md5('unprocessed') : md5($media->created_at);
|
||||||
|
$url = Storage::url($path) . "?v={$hash}";
|
||||||
return url($url);
|
return url($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue