From 99b30b5894781b28aa410296fdbe44785dbe62d1 Mon Sep 17 00:00:00 2001 From: cwilvx Date: Tue, 8 Oct 2024 10:49:03 +0300 Subject: [PATCH] fix some AI bs --- app/lib/home/recentlyplayed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/lib/home/recentlyplayed.py b/app/lib/home/recentlyplayed.py index ec27fcd8..dcf00459 100644 --- a/app/lib/home/recentlyplayed.py +++ b/app/lib/home/recentlyplayed.py @@ -202,16 +202,17 @@ def get_recently_played(limit=7): BATCH_SIZE = 200 current_index = 0 + entries = ScrobbleTable.get_all(0, BATCH_SIZE) - max_iterations = 20 # Safeguard against unexpected infinite loops + max_iterations = 20 # Safeguard against unexpected infinite loops iterations = 0 while len(items) < limit and iterations < max_iterations: - create_items(entries[current_index : current_index + BATCH_SIZE]) + create_items(entries) current_index += BATCH_SIZE if len(items) < limit: - entries = ScrobbleTable.get_all(current_index, BATCH_SIZE) + entries = ScrobbleTable.get_all(current_index + 1, BATCH_SIZE) if not entries: break