.
This commit is contained in:
parent
00be1b8eb1
commit
949b6e4bc3
@ -1,2 +1,4 @@
|
||||
#!/usr/bin/env python3.12
|
||||
# pylint: disable=empty-docstring
|
||||
"""
|
||||
"""
|
@ -36,8 +36,10 @@ class Aggregate:
|
||||
search_result: Optional[LyricsResult] = None
|
||||
for source in sources:
|
||||
if source.label.lower() in self.exclude_methods:
|
||||
if source.label.lower() != "cache":
|
||||
logging.info("Skipping source: %s, excluded.", source.label)
|
||||
continue
|
||||
logging.info("Cache exclude requested, ignoring")
|
||||
search_result = await source.search(artist=artist, song=song,
|
||||
plain=plain)
|
||||
if search_result:
|
||||
|
@ -102,7 +102,7 @@ class Cache:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
||||
"""
|
||||
search
|
||||
@ -112,6 +112,7 @@ class Cache:
|
||||
- LyricsResult corresponding to nearest match found (if found), **None** otherwise
|
||||
"""
|
||||
try:
|
||||
# pylint: enable=unused-argument
|
||||
artist: str = artist.strip().lower()
|
||||
song: str = song.strip().lower()
|
||||
search_params: Optional[tuple] = None
|
||||
|
@ -37,12 +37,14 @@ class Genius:
|
||||
self.matcher = utils.TrackMatcher()
|
||||
self.cache = cache.Cache()
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
||||
"""
|
||||
@artist: the artist to search
|
||||
@song: the song to search
|
||||
"""
|
||||
try:
|
||||
# pylint: enable=unused-argument
|
||||
artist: str = artist.strip().lower()
|
||||
song: str = song.strip().lower()
|
||||
time_start: float = time.time()
|
||||
|
Loading…
x
Reference in New Issue
Block a user