1
0
Fork 0
forked from mirror/pixelfed

Update Media model

This commit is contained in:
Daniel Supernault 2018-10-09 19:24:42 -06:00
parent 679a566466
commit 64f1118883
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -32,4 +32,27 @@ class Media extends Model
return url($url);
}
public function mimeType()
{
return explode('/', $this->mime)[0];
}
public function activityVerb()
{
$verb = 'Image';
switch ($this->mimeType()) {
case 'image':
break;
case 'video':
$verb = 'Video';
break;
default:
$verb = 'Document';
break;
}
return $verb;
}
}