4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-18 06:57:05 +00:00

Add "auto_assign" to custom field.

This commit is contained in:
Buster "Silver Eagle" Neece 2019-09-28 15:56:13 -05:00
parent 9a2f837586
commit d207a8ae83
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 34 additions and 1 deletions

View File

@ -25,7 +25,7 @@ return [
],
],
'auto_set_from' => [
'auto_assign' => [
'select',
[
'label' => __('Automatically Set from ID3v2 Value'),

View File

@ -47,6 +47,15 @@ class CustomField
*/
protected $short_name;
/**
* @ORM\Column(name="auto_assign", type="string", length=100, nullable=true)
*
* @OA\Property()
*
* @var string|null An ID3v2 field to automatically assign to this value, if it exists in the media file.
*/
protected $auto_assign;
/**
* @return int
*/
@ -97,4 +106,28 @@ class CustomField
$this->short_name = $this->_truncateString($short_name, 100);
}
}
/**
* @return string|null
*/
public function getAutoAssign(): ?string
{
return $this->auto_assign;
}
/**
* @return bool
*/
public function hasAutoAssign(): bool
{
return !empty($this->auto_assign);
}
/**
* @param string|null $auto_assign
*/
public function setAutoAssign(?string $auto_assign): void
{
$this->auto_assign = $auto_assign;
}
}