1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 00:05:29 +00:00

Update Status model, add cache busting to unprocessed media urls

This commit is contained in:
Daniel Supernault 2018-06-05 19:54:48 -06:00
parent 85d164ce07
commit 8194432073

View file

@ -42,8 +42,10 @@ class Status extends Model
public function mediaUrl()
{
$path = $this->firstMedia()->media_path;
$url = Storage::url($path);
$media = $this->firstMedia();
$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);
}