22 lines
377 B
Python
22 lines
377 B
Python
from attrs import define
|
|
|
|
|
|
@define
|
|
class BaseSongItem:
|
|
name: str
|
|
id: str
|
|
artists: list[str]
|
|
preview_url: str | None
|
|
thumbnail: str
|
|
|
|
@property
|
|
def all_artists(self):
|
|
return ', '.join(self.artists)
|
|
|
|
@property
|
|
def full_name(self):
|
|
return f"{self.all_artists} - {self.name}"
|
|
|
|
def __str__(self):
|
|
return self.full_name
|