From: relic664 <138946165+relic664@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:24:18 +0000 (-0500) Subject: fix: cache check for expire (#3087) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=70f4d6c43fb8a8517ab0a906e594e3883ca8b0b8;p=music-assistant-server.git fix: cache check for expire (#3087) * fix: cache check for expire * fixed formatting --- diff --git a/music_assistant/controllers/cache.py b/music_assistant/controllers/cache.py index cc81b605..da8e174b 100644 --- a/music_assistant/controllers/cache.py +++ b/music_assistant/controllers/cache.py @@ -119,10 +119,14 @@ class CacheController(CoreController): return cache_data[0] # fall back to db cache if ( - db_row := await self.database.get_row( - DB_TABLE_CACHE, {"category": category, "provider": provider, "key": key} + ( + db_row := await self.database.get_row( + DB_TABLE_CACHE, {"category": category, "provider": provider, "key": key} + ) ) - ) and (not checksum or (db_row["checksum"] == checksum and db_row["expires"] >= cur_time)): + and db_row["expires"] >= cur_time + and (not checksum or db_row["checksum"] == checksum) + ): try: data = await async_json_loads(db_row["data"]) except Exception as exc: