fix(ui): revert history dedup to preserve play frequency
This commit is contained in:
parent
446b6fff55
commit
7008de33b0
1 changed files with 3 additions and 4 deletions
7
js/db.js
7
js/db.js
|
|
@ -112,13 +112,12 @@ export class MusicDatabase {
|
||||||
cursorReq.onsuccess = (e) => {
|
cursorReq.onsuccess = (e) => {
|
||||||
const cursor = e.target.result;
|
const cursor = e.target.result;
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
if (cursor.value.id === track.id) {
|
const lastTrack = cursor.value;
|
||||||
|
if (lastTrack.id === track.id) {
|
||||||
store.delete(cursor.primaryKey);
|
store.delete(cursor.primaryKey);
|
||||||
}
|
}
|
||||||
cursor.continue();
|
|
||||||
} else {
|
|
||||||
store.put(entry);
|
|
||||||
}
|
}
|
||||||
|
store.put(entry);
|
||||||
};
|
};
|
||||||
|
|
||||||
cursorReq.onerror = (_e) => {
|
cursorReq.onerror = (_e) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue