Skip to content

Artist Index

ArtistIndex(subsonic, ignoredArticles, index=None)

Bases: Model

Object that holds all the info about an artist index.

Attributes:

Name Type Description
ignored_articles list[str]

Ignored articles in the index.

index dict[str, list[Artist]] | None

Dictionary that holds the index, where the key is the index letter and the value a list of objects that holds all the info related with the artists in that are in the given index.

Source code in .venv/lib/python3.11/site-packages/knuckles/models/_artist_index.py
def __init__(
    self,
    subsonic: "Subsonic",
    ignoredArticles: str,
    index: list[dict[str, Any]] | None = None,
) -> None:
    super().__init__(subsonic)

    self.ignored_articles = ignoredArticles

    self.index: dict[str, list[Artist]] | None

    if index is None:
        self.index = None
        return

    self.index = {}

    for entry in index:
        self.index[entry["name"]] = [
            Artist(subsonic=self._subsonic, **artist) for artist in entry["artist"]
        ]