Files
deezspot-spotizerr-dev/deezspot/models/callback/artist.py
2025-06-10 15:37:45 -06:00

39 lines
1.1 KiB
Python

#!/usr/bin/python3
from dataclasses import dataclass, field
from typing import List, Optional
from .common import IDs
@dataclass
class artistTrackObject:
"""
An artist when nested inside a track context.
No genres, no albums—just identifying info.
"""
type: str = "artistTrack"
name: str = ""
ids: IDs = field(default_factory=IDs)
@dataclass
class albumArtistObject:
"""Album when nested inside an artist context."""
type: str = "albumArtist"
album_type: str = "" # "album" | "single" | "compilation"
title: str = ""
release_date: dict = field(default_factory=dict) # ReleaseDate as dict
total_tracks: int = 0
ids: IDs = field(default_factory=IDs)
@dataclass
class artistObject:
"""A full artist record, with nested albumArtistObject[] for a discography."""
type: str = "artist"
name: str = ""
genres: List[str] = field(default_factory=list)
ids: IDs = field(default_factory=IDs)
# Nested: artist's albums without redundant artist info
albums: List[albumArtistObject] = field(default_factory=list)