This commit is contained in:
NoLogicAlan committed 2026-05-14 15:36:29 +03:00
1 parent dc238213c5
commit 506d3c4cf8
7 files changed
+107 -277

No files matched your search

+20 -2
View File
@@ -866,9 +866,27 @@ export class LastFmManager {
const [rows] = await pool.execute(
"SELECT linked_users FROM lastfm_stats WHERE id = 1"
);
return Number(rows[0]?.linked_users ?? 0);
const count = Number(rows[0]?.linked_users ?? 0);
this._linkedUsersCache = count;
return count;
} catch {
return 0;
return this._linkedUsersCache ?? 0;
}
}
async getStoredTotalScrobbles() {
if (!this.enabled) return 0;
try {
const pool = await this._getPool();
const [rows] = await pool.execute(
"SELECT stored_scrobbles FROM lastfm_stats WHERE id = 1"
);
const total = Number(rows[0]?.stored_scrobbles ?? this._totalScrobblesCache ?? 0);
this._totalScrobblesCache = total;
this._totalScrobblesCacheExpiry = Date.now() + 10 * 60 * 1000;
return total;
} catch {
return this._totalScrobblesCache ?? 0;
}
}