.
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
|
search_result: Optional[LyricsResult] = None
|
||||||
for source in sources:
|
for source in sources:
|
||||||
if source.label.lower() in self.exclude_methods:
|
if source.label.lower() in self.exclude_methods:
|
||||||
logging.info("Skipping source: %s, excluded.", source.label)
|
if source.label.lower() != "cache":
|
||||||
continue
|
logging.info("Skipping source: %s, excluded.", source.label)
|
||||||
|
continue
|
||||||
|
logging.info("Cache exclude requested, ignoring")
|
||||||
search_result = await source.search(artist=artist, song=song,
|
search_result = await source.search(artist=artist, song=song,
|
||||||
plain=plain)
|
plain=plain)
|
||||||
if search_result:
|
if search_result:
|
||||||
|
@ -102,7 +102,7 @@ class Cache:
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=unused-argument
|
||||||
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
||||||
"""
|
"""
|
||||||
search
|
search
|
||||||
@ -112,6 +112,7 @@ class Cache:
|
|||||||
- LyricsResult corresponding to nearest match found (if found), **None** otherwise
|
- LyricsResult corresponding to nearest match found (if found), **None** otherwise
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# pylint: enable=unused-argument
|
||||||
artist: str = artist.strip().lower()
|
artist: str = artist.strip().lower()
|
||||||
song: str = song.strip().lower()
|
song: str = song.strip().lower()
|
||||||
search_params: Optional[tuple] = None
|
search_params: Optional[tuple] = None
|
||||||
|
@ -37,12 +37,14 @@ class Genius:
|
|||||||
self.matcher = utils.TrackMatcher()
|
self.matcher = utils.TrackMatcher()
|
||||||
self.cache = cache.Cache()
|
self.cache = cache.Cache()
|
||||||
|
|
||||||
|
# pylint: disable=unused-argument
|
||||||
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
|
||||||
"""
|
"""
|
||||||
@artist: the artist to search
|
@artist: the artist to search
|
||||||
@song: the song to search
|
@song: the song to search
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# pylint: enable=unused-argument
|
||||||
artist: str = artist.strip().lower()
|
artist: str = artist.strip().lower()
|
||||||
song: str = song.strip().lower()
|
song: str = song.strip().lower()
|
||||||
time_start: float = time.time()
|
time_start: float = time.time()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user