moar
This commit is contained in:
parent
f3336b09ac
commit
861f4766b3
@ -23,6 +23,7 @@ class Aggregate:
|
|||||||
|
|
||||||
async def search(self, artist: str, song: str) -> Optional[LyricsResult]:
|
async def search(self, artist: str, song: str) -> Optional[LyricsResult]:
|
||||||
"""Aggregate Search"""
|
"""Aggregate Search"""
|
||||||
|
logging.info("Performing aggregate search")
|
||||||
cache_search = cache.Cache()
|
cache_search = cache.Cache()
|
||||||
genius_search = genius.Genius()
|
genius_search = genius.Genius()
|
||||||
lrclib_search = lrclib.LRCLib()
|
lrclib_search = lrclib.LRCLib()
|
||||||
|
@ -50,6 +50,8 @@ class Cache:
|
|||||||
artist = artist.strip().lower()
|
artist = artist.strip().lower()
|
||||||
song = song.strip().lower()
|
song = song.strip().lower()
|
||||||
try:
|
try:
|
||||||
|
logging.info("Searching %s - %s on %s",
|
||||||
|
artist, song, self.label)
|
||||||
async with sqlite3.connect(self.cache_db, timeout=2) as db_conn:
|
async with sqlite3.connect(self.cache_db, timeout=2) as db_conn:
|
||||||
await db_conn.enable_load_extension(True)
|
await db_conn.enable_load_extension(True)
|
||||||
for ext in self.sqlite_exts:
|
for ext in self.sqlite_exts:
|
||||||
|
@ -38,6 +38,8 @@ class Genius:
|
|||||||
@song: the song to search
|
@song: the song to search
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
logging.info("Searching %s - %s on %s",
|
||||||
|
artist, song, self.label)
|
||||||
artist = artist.strip().lower()
|
artist = artist.strip().lower()
|
||||||
song = song.strip().lower()
|
song = song.strip().lower()
|
||||||
search_term = f'{artist}%20{song}'
|
search_term = f'{artist}%20{song}'
|
||||||
|
@ -34,6 +34,8 @@ class LRCLib:
|
|||||||
@song: the song to search
|
@song: the song to search
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
logging.info("Searching %s - %s on %s",
|
||||||
|
artist, song, self.label)
|
||||||
artist = artist.strip().lower()
|
artist = artist.strip().lower()
|
||||||
song = song.strip().lower()
|
song = song.strip().lower()
|
||||||
returned_lyrics = ''
|
returned_lyrics = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user