fix: bugs

This commit is contained in:
qier222 2021-04-20 14:25:26 +08:00
parent fc08992244
commit 2f0e8e1e24
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
4 changed files with 35 additions and 20 deletions

View file

@ -7,7 +7,7 @@ const db = new Dexie("yesplaymusic");
db.version(2)
.stores({
trackSources: "&id, createTime",
trackSources: "&id",
})
.upgrade((tx) =>
tx
@ -29,8 +29,9 @@ async function deleteExcessCache() {
if (
store.state.settings.cacheLimit === false ||
tracksCacheBytes < store.state.settings.cacheLimit * Math.pow(1024, 2)
)
) {
return;
}
try {
const delCache = await db.trackSources.orderBy("createTime").first();
await db.trackSources.delete(delCache.id);