From 2e15b0549b928b47df0fd17098e4c8058753be7f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Dec 2022 20:08:40 +0530 Subject: [PATCH] ... --- src/calibre/srv/last_read.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/srv/last_read.py b/src/calibre/srv/last_read.py index fc30af9527..6d7597deb1 100644 --- a/src/calibre/srv/last_read.py +++ b/src/calibre/srv/last_read.py @@ -59,8 +59,7 @@ class LastReadCache: (library_id, book_id, fmt, user, cfi, epoch, pos_frac, tooltip)) items = tuple(self.get('SELECT id FROM last_read_positions WHERE user=? ORDER BY id DESC', (user,), all=True)) if len(items) > self.limit: - limit_id = items[self.limit][0] - self.execute('DELETE FROM last_read_positions WHERE user=? AND id <= ?', (user, limit_id)) + self.execute('DELETE FROM last_read_positions WHERE user=? AND id <= ?', (user, items[self.limit][0])) return epoch def get_recently_read(self, user):