From 78224d17b8f227f00a4ed9c136980929521167af Mon Sep 17 00:00:00 2001 From: cwilvx Date: Mon, 30 Dec 2024 13:00:33 +0300 Subject: [PATCH] fix: index error on empty recents update --- app/lib/recipes/recents.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/lib/recipes/recents.py b/app/lib/recipes/recents.py index a9123d3c..1a5ed760 100644 --- a/app/lib/recipes/recents.py +++ b/app/lib/recipes/recents.py @@ -37,12 +37,15 @@ class RecentlyPlayed(HomepageRoutine): ) item = items[0] - store_entry = HomepageStore.entries[self.store_key].items[ - self.userids[0] - ][0] + try: + store_entry = HomepageStore.entries[self.store_key].items[ + self.userids[0] + ][0] + except IndexError: + store_entry = None if ( - item["type"] + item["hash"] + store_entry and item["type"] + item["hash"] == store_entry["type"] + store_entry["hash"] ): # If the item is the same as the one in the store