From 7008de33b0990b4cee3fe9aba91f9070e3c6e7c6 Mon Sep 17 00:00:00 2001 From: akane <107654710+genericness@users.noreply.github.com> Date: Sat, 21 Mar 2026 12:33:25 -0700 Subject: [PATCH] fix(ui): revert history dedup to preserve play frequency --- js/db.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/db.js b/js/db.js index 588292f..5f01564 100644 --- a/js/db.js +++ b/js/db.js @@ -112,13 +112,12 @@ export class MusicDatabase { cursorReq.onsuccess = (e) => { const cursor = e.target.result; if (cursor) { - if (cursor.value.id === track.id) { + const lastTrack = cursor.value; + if (lastTrack.id === track.id) { store.delete(cursor.primaryKey); } - cursor.continue(); - } else { - store.put(entry); } + store.put(entry); }; cursorReq.onerror = (_e) => {