various/stale

This commit is contained in:
2026-01-25 13:14:00 -05:00
parent 10ccf8c8eb
commit 97fd7dd67d
14 changed files with 501 additions and 64 deletions

View File

@@ -5,7 +5,7 @@ from sqlalchemy.future import select
from lyric_search import utils
from lyric_search.constructors import LyricsResult
from lyric_search.models import Tracks, Lyrics, AsyncSessionLocal
from . import redis_cache
from . import redis_cache, cache
logger = logging.getLogger()
log_level = logging.getLevelName(logger.level)
@@ -19,6 +19,7 @@ class LRCLib:
self.datautils = utils.DataUtils()
self.matcher = utils.TrackMatcher()
self.redis_cache = redis_cache.RedisCache()
self.cache = cache.Cache()
async def search(
self,
@@ -152,6 +153,9 @@ class LRCLib:
)
await self.redis_cache.increment_found_count(self.label)
# Store plain lyrics to Redis cache (like Genius does)
if plain:
await self.cache.store(matched)
return matched
except Exception as e: