misc
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user