misc
This commit is contained in:
parent
645d1c49c0
commit
d27bc450f5
@ -20,6 +20,6 @@ class LyricsResult:
|
||||
confidence: int
|
||||
time: float = 0.00
|
||||
|
||||
def todict(self):
|
||||
def todict(self) -> dict:
|
||||
"""Return as dict"""
|
||||
return asdict(self)
|
@ -18,7 +18,7 @@ class Aggregate:
|
||||
Aggregate all source methods
|
||||
"""
|
||||
|
||||
def __init__(self, exclude_methods=None):
|
||||
def __init__(self, exclude_methods=None) -> None:
|
||||
if not exclude_methods:
|
||||
exclude_methods: list = []
|
||||
self.exclude_methods = exclude_methods
|
||||
|
@ -22,7 +22,7 @@ log_level = logging.getLevelName(logger.level)
|
||||
|
||||
class Cache:
|
||||
"""Cache Search Module"""
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self.cache_db: str = os.path.join("/", "var",
|
||||
"lib", "singerdbs",
|
||||
"cached_lyrics.db")
|
||||
|
@ -27,7 +27,7 @@ class InvalidResponseException(Exception):
|
||||
|
||||
class Genius:
|
||||
"""Genius Search Module"""
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self.label: str = "Genius"
|
||||
self.genius_url: str = private.GENIUS_URL
|
||||
self.genius_search_url: str = f'{self.genius_url}api/search/song?q='
|
||||
|
@ -23,7 +23,7 @@ class InvalidResponseException(Exception):
|
||||
|
||||
class LRCLib:
|
||||
"""LRCLib Search Module"""
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self.label: str = "LRCLib"
|
||||
self.lrclib_url: str = "https://lrclib.net/api/search"
|
||||
self.headers: dict = common.SCRAPE_HEADERS
|
||||
|
@ -30,12 +30,12 @@ class RedisCache:
|
||||
Redis Cache Methods
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self.redis_client = redis.Redis(password=private.REDIS_PW)
|
||||
self.notifier = notifier.DiscordNotifier()
|
||||
self.notify_warnings = True
|
||||
|
||||
async def create_index(self):
|
||||
async def create_index(self) -> None:
|
||||
"""Create Index"""
|
||||
try:
|
||||
schema = (
|
||||
@ -51,7 +51,7 @@ class RedisCache:
|
||||
except Exception as e:
|
||||
await self.notifier.send(f"ERROR @ {__file__}", f"Failed to create idx: {str(e)}")
|
||||
|
||||
async def search(self, **kwargs):
|
||||
async def search(self, **kwargs) -> list[tuple]:
|
||||
"""
|
||||
Search Redis Cache
|
||||
Args:
|
||||
|
Loading…
x
Reference in New Issue
Block a user