This commit is contained in:
2025-01-22 06:38:40 -05:00
parent 38dbddd297
commit 4b16a4a265
5 changed files with 64 additions and 11 deletions

View File

@@ -10,9 +10,7 @@ from typing import Optional
from aiohttp import ClientTimeout, ClientSession
from bs4 import BeautifulSoup, ResultSet
import html as htm
from . import private
from . import common
from . import cache
from . import private, common, cache, redis_cache
from lyric_search_new import utils
from lyric_search_new.constructors import LyricsResult
@@ -36,6 +34,7 @@ class Genius:
self.datautils = utils.DataUtils()
self.matcher = utils.TrackMatcher()
self.cache = cache.Cache()
self.redis_cache = redis_cache.RedisCache()
# pylint: disable=unused-argument
async def search(self, artist: str, song: str, **kwargs) -> Optional[LyricsResult]:
@@ -123,6 +122,7 @@ class Genius:
lyrics=returned_lyrics,
confidence=confidence,
time=time_diff)
await self.redis_cache.increment_found_count(self.label)
await self.cache.store(matched)
return matched