forked from mirror/pixelfed
Update Media model
This commit is contained in:
parent
679a566466
commit
64f1118883
1 changed files with 23 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue