fix: getStorageInfo快速估算(3s)+后台全量遍历校准; quark-cleanup去kps依赖; QuarkDriver支持回调

This commit is contained in:
2026-05-15 18:31:52 +08:00
parent dfcdddabad
commit cf965bcfee
3 changed files with 50 additions and 24 deletions

View File

@@ -329,7 +329,16 @@ export async function refreshAllStorageInfo(): Promise<void> {
try {
const { QuarkDriver } = require('./drivers/quark.driver');
const driver = new QuarkDriver({ cookie: decrypt(cfg.cookie!), nickname: cfg.nickname });
const storage = await driver.getStorageInfo();
const storage = await driver.getStorageInfo(
decrypt(cfg.cookie!),
(fullUsed: string, total: string) => {
const db = getDb();
db.prepare(
`UPDATE cloud_configs SET storage_used = ?, storage_total = ? WHERE id = ?`
).run(fullUsed, total, cfg.id);
console.log(`[Storage] Background calibration done for quark#${cfg.id}: ${fullUsed} / ${total}`);
}
);
if (storage.totalBytes > 0 || storage.usedBytes > 0) {
const db = getDb();
db.prepare(