Skip to content

sok.media.music.album

Album media class for music organization.

Provides the Album class for representing and organizing music albums with track lists, artist info, and release metadata.

Album

class Album(title: str, artist: str = '', year: Optional[int] = None)

Bases: MediaItem

Class for managing music albums.

Represents a music album with tracks, artist info, and release metadata.

Initialize an Album instance.

Parameters

NameTypeDefaultDescription
titlestrThe album title.
artiststr''Artist or band name (default: empty).
yearOptional[int]NoneRelease year (default: None).
Source

Attributes

NameTypeDescription
artist

Album artist or band name.

genre

Primary musical genre.

label

Record label name.

tracksList[Dict[str, Any]]

List of track dictionaries with metadata.

year

Release year.

get_folder_structure

def get_folder_structure() -> List[str]:

Return the recommended folder hierarchy.

Returns

  • List[str]List of folder names [artist, album].
Source

get_formatted_name

def get_formatted_name() -> str:

Return the formatted album folder name.

Returns

  • strFormatted string like 'Artist - Album (Year)'.
Source

get_track_filename

def get_track_filename(track_number: int, track_title: str) -> str:

Generate the filename for a track.

Parameters

NameTypeDescription
track_numberintThe track's position on the album.
track_titlestrThe track's title.

Returns

  • strFormatted filename like '01 - Track Title'.
Source
Built with Kiln