reorder var definitions after try for consistency
This commit is contained in:
parent
861f4766b3
commit
688e6bf30c
@ -47,9 +47,9 @@ class Cache:
|
|||||||
Returns:
|
Returns:
|
||||||
- LyricsResult corresponding to nearest match found (if found), **None** otherwise
|
- LyricsResult corresponding to nearest match found (if found), **None** otherwise
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
artist = artist.strip().lower()
|
artist = artist.strip().lower()
|
||||||
song = song.strip().lower()
|
song = song.strip().lower()
|
||||||
try:
|
|
||||||
logging.info("Searching %s - %s on %s",
|
logging.info("Searching %s - %s on %s",
|
||||||
artist, song, self.label)
|
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:
|
||||||
|
@ -38,10 +38,10 @@ 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()
|
||||||
|
logging.info("Searching %s - %s on %s",
|
||||||
|
artist, song, self.label)
|
||||||
search_term = f'{artist}%20{song}'
|
search_term = f'{artist}%20{song}'
|
||||||
returned_lyrics = ''
|
returned_lyrics = ''
|
||||||
async with ClientSession() as client:
|
async with ClientSession() as client:
|
||||||
|
@ -34,10 +34,10 @@ 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()
|
||||||
|
logging.info("Searching %s - %s on %s",
|
||||||
|
artist, song, self.label)
|
||||||
returned_lyrics = ''
|
returned_lyrics = ''
|
||||||
async with ClientSession() as client:
|
async with ClientSession() as client:
|
||||||
async with client.get(self.lrclib_url,
|
async with client.get(self.lrclib_url,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user