Update Video model
This commit is contained in:
parent
9bcf7b2ff4
commit
d9a30fbfc4
@ -18,6 +18,17 @@ class Video extends Model
|
||||
{
|
||||
use HasFactory, HasSnowflakePrimary;
|
||||
|
||||
/**
|
||||
* Status Bitmask
|
||||
* 0 = Unused
|
||||
* 1 = Pending Transcoding
|
||||
* 2 = Published
|
||||
* 3 = Reserved
|
||||
* 4 = Archived
|
||||
* 5 = Reserved
|
||||
* 6 = Admin unpublished
|
||||
**/
|
||||
|
||||
/**
|
||||
* Indicates if the IDs are auto-incrementing.
|
||||
*
|
||||
@ -35,6 +46,7 @@ class Video extends Model
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'status' => 'integer',
|
||||
'profile_id' => 'string',
|
||||
'is_sensitive' => 'boolean',
|
||||
'media_metadata' => 'array',
|
||||
@ -53,6 +65,17 @@ class Video extends Model
|
||||
$query->where('comment_state', 4);
|
||||
}
|
||||
|
||||
public function statusLabel()
|
||||
{
|
||||
return match ($this->status) {
|
||||
1 => 'pending',
|
||||
2 => 'published',
|
||||
4 => 'archived',
|
||||
6 => 'unpublished',
|
||||
default => null
|
||||
};
|
||||
}
|
||||
|
||||
public function hashid()
|
||||
{
|
||||
return HashidService::encode($this->id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user