From 949b6e4bc35af4b110e37e5874ecdc7f15137c83 Mon Sep 17 00:00:00 2001 From: codey Date: Thu, 16 Jan 2025 09:37:50 -0500 Subject: [PATCH] . --- lyric_search_new/__init__.py | 2 ++ lyric_search_new/sources/aggregate.py | 6 ++++-- lyric_search_new/sources/cache.py | 3 ++- lyric_search_new/sources/genius.py | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lyric_search_new/__init__.py b/lyric_search_new/__init__.py index 5a4829a..6a78490 100644 --- a/lyric_search_new/__init__.py +++ b/lyric_search_new/__init__.py @@ -1,2 +1,4 @@ +#!/usr/bin/env python3.12 +# pylint: disable=empty-docstring """ """ \ No newline at end of file diff --git a/lyric_search_new/sources/aggregate.py b/lyric_search_new/sources/aggregate.py index 5812fdb..b20b338 100644 --- a/lyric_search_new/sources/aggregate.py +++ b/lyric_search_new/sources/aggregate.py @@ -36,8 +36,10 @@ class Aggregate: search_result: Optional[LyricsResult] = None for source in sources: if source.label.lower() in self.exclude_methods: - logging.info("Skipping source: %s, excluded.", source.label) - continue + 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: diff --git a/lyric_search_new/sources/cache.py b/lyric_search_new/sources/cache.py index 79f37eb..93fc82a 100644 --- a/lyric_search_new/sources/cache.py +++ b/lyric_search_new/sources/cache.py @@ -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 diff --git a/lyric_search_new/sources/genius.py b/lyric_search_new/sources/genius.py index 8aca6da..78532df 100644 --- a/lyric_search_new/sources/genius.py +++ b/lyric_search_new/sources/genius.py @@ -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()