Did some refactor, add YouTube as search variant
This commit is contained in:
1
bot/modules/common/__init__.py
Normal file
1
bot/modules/common/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
pass
|
||||
1
bot/modules/common/song/__init__.py
Normal file
1
bot/modules/common/song/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .song import BaseSongItem
|
||||
21
bot/modules/common/song/song.py
Normal file
21
bot/modules/common/song/song.py
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
Reference in New Issue
Block a user