This commit is contained in:
codey 2025-01-16 09:37:50 -05:00
parent 00be1b8eb1
commit 949b6e4bc3
4 changed files with 10 additions and 3 deletions

View File

@ -1,2 +1,4 @@
#!/usr/bin/env python3.12
# pylint: disable=empty-docstring
""" """
""" """

View File

@ -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:

View File

@ -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

View File

@ -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()