This commit is contained in:
2025-01-16 07:14:36 -05:00
parent 915b77fe19
commit d58f2f9413
5 changed files with 21 additions and 12 deletions

View File

@@ -21,8 +21,11 @@ class Aggregate:
exclude_methods: list = []
self.exclude_methods = exclude_methods
async def search(self, artist: str, song: str) -> Optional[LyricsResult]:
async def search(self, artist: str, song: str, plain: bool = True) -> Optional[LyricsResult]:
"""Aggregate Search"""
if not plain:
logging.info("LRCs requested, limiting search to LRCLib")
self.exclude_methods = ["genius", "cache"]
logging.info("Performing aggregate search")
cache_search = cache.Cache()
genius_search = genius.Genius()
@@ -35,7 +38,8 @@ class Aggregate:
if source.label.lower() in self.exclude_methods:
logging.info("Skipping source: %s, excluded.", source.label)
continue
search_result = await source.search(artist, song)
search_result = await source.search(artist=artist, song=song,
plain=plain)
if search_result:
break
logging.info("%s: NOT FOUND!", source.label)