Station File

class AzuracastPy.models.StationFile(unique_id: str, album: str, genre: str, lyrics: str, isrc: str, length: float, length_text: str, path: str, mtime: int, amplify, fade_overlap, fade_in, fade_out, cue_in, cue_out, art_updated_at: int, playlists: List[Playlist], id: int, song_id: str, text: str, artist: str, title: str, custom_fields: List[str], links: Links, _station)

Represents an uploaded file on a station.

__init__(unique_id: str, album: str, genre: str, lyrics: str, isrc: str, length: float, length_text: str, path: str, mtime: int, amplify, fade_overlap, fade_in, fade_out, cue_in, cue_out, art_updated_at: int, playlists: List[Playlist], id: int, song_id: str, text: str, artist: str, title: str, custom_fields: List[str], links: Links, _station)

Initializes a StationFile object.

Note

This class should not be initialized directly. Instead, obtain an instance via: upload(), __call__() or files().

delete()

Deletes the file from the station.

Sets all attributes of the current StationFile object to None.

Usage:

station.file.delete()
edit(title: str | None = None, artist: str | None = None, path: str | None = None, genre: str | None = None, album: str | None = None, lyrics: str | None = None, isrc: str | None = None, playlists: List[str] | None = None, amplify: int | None = None, fade_overlap: int | None = None, fade_in: int | None = None, fade_out: int | None = None, cue_in: int | None = None, cue_out: int | None = None)

Edits the file’s properties.

Updates all edited attributes of the current StationFile object.

Parameters:
  • title – (Optional) The new title of the song. Default: None.

  • artist – (Optional) The new artist of the song. Default: None.

  • path – (Optional) The new relative path of the song in the station’s media directory. Default: None.

  • genre – (Optional) The new genre of the song. Default: None.

  • album – (Optional) The new album of the song. Default: None.

  • lyrics – (Optional) The new lyrics of the song. Default: None.

  • isrc – (Optional) The new International Standard Recording Code of the song. Default: None.

  • playlists

    (Optional) The new list of playlists that the song has been added to. Default: None.

    Warning

    This will overwrite the file’s existing playlists. Use the add() and remove() methods to interact with the file’s existing playlists.

  • amplify – (Optional) The volume in decibels to amplify the track with. Leave as None to use the system default. Default: None.

  • fade_overlap – (Optional) The time that this song should overlap its surrounding songs when fading. Leave as None to use the system default. Default: None.

  • fade_in – (Optional) The time period that the song should fade in. Leave as None to use the system default. Default: None.

  • fade_out – (Optional) The time period that the song should fade out. Leave as None to use the system default. Default: None.

  • cue_in – (Optional) Seconds from the start of the song that the AutoDJ should start playing. Default: None.

  • cue_out – (Optional) Seconds from the start of the song that the AutoDJ should stop playing. Default: None.

Usage:

station.file.edit(
    title="Never gonna give you up",
    artist="Lil Wayne",
    lyrics="I'm so tired",
    playlists=["playlist1", "playlist2"]
)
playlist

An instance of PlaylistHelper.

Provides the interface for working with the playlists that this file is in.

For example, to add the file to one or more playlists:

file.playlist.add("playlist")

file.playlist.add("playlist1", "playlist2")

To remove the file from one or more playlists:

file.playlist.remove("playlist")

file.playlist.remove("playlist1", "playlist2")