mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
idk is that work
This commit is contained in:
1 parent
6b4bcf143c
commit
48bebc950d
2 files changed
+57
-13
No files matched your search
@@ -864,9 +864,9 @@ export class LastFmManager {
|
||||
try {
|
||||
const pool = await this._getPool();
|
||||
const [rows] = await pool.execute(
|
||||
"SELECT linked_users FROM lastfm_stats WHERE id = 1"
|
||||
"SELECT COUNT(*) AS total FROM lastfm_users"
|
||||
);
|
||||
const count = Number(rows[0]?.linked_users ?? 0);
|
||||
const count = Number(rows[0]?.total ?? 0);
|
||||
this._linkedUsersCache = count;
|
||||
return count;
|
||||
} catch {
|
||||
@@ -879,9 +879,9 @@ export class LastFmManager {
|
||||
try {
|
||||
const pool = await this._getPool();
|
||||
const [rows] = await pool.execute(
|
||||
"SELECT stored_scrobbles FROM lastfm_stats WHERE id = 1"
|
||||
"SELECT COALESCE(SUM(scrobble_count), 0) AS total FROM lastfm_users"
|
||||
);
|
||||
const total = Number(rows[0]?.stored_scrobbles ?? this._totalScrobblesCache ?? 0);
|
||||
const total = Number(rows[0]?.total ?? this._totalScrobblesCache ?? 0);
|
||||
this._totalScrobblesCache = total;
|
||||
this._totalScrobblesCacheExpiry = Date.now() + 10 * 60 * 1000;
|
||||
return total;
|
||||
|
||||
Reference in new issue
Block a user