From 70f4d6c43fb8a8517ab0a906e594e3883ca8b0b8 Mon Sep 17 00:00:00 2001 From: relic664 <138946165+relic664@users.noreply.github.com> Date: Thu, 5 Feb 2026 05:24:18 -0500 Subject: [PATCH] fix: cache check for expire (#3087) * fix: cache check for expire * fixed formatting --- music_assistant/controllers/cache.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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: -- 2.34.1