Custom Field Helper
- class AzuracastPy.models.administration.helpers.CustomFieldHelper(_admin)
Provides a set of functions to interact with radio custom fields.
- __call__(id: int) CustomField
Retrieves a specific custom field from the admin.
- Parameters:
id – The numerical ID of the playlist to be retrieved.
- Returns:
A
CustomFieldobject.
Usage:
custom_field = admin.custom_field(1)
- __init__(_admin)
Initializes a
CustomFieldHelperobject for aNowPlayinginstance.Note
This class should not be initialized directly. Instead, obtain an instance via:
custom_field.
- create(name: str, short_name: str | None = None, auto_assign_value: AutoAssignValues | None = None) CustomField
Adds a new custom field to the radio.
- Parameters:
name – The name of the custom field.
short_name – (Optional) The short name of the custom field. Leave as
Noneto generate a default short_name value. Default:None.auto_assign_value – (Optional) A metadata field that, if present, will be used to set this field’s value. Default:
None.
Usage:
from AzuracastPy.enums import AutoAssignValues admin.custom_field.create( name="New Custom Field", auto_assign_value=AutoAssignValues.ALBUM )