mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
hotfix
This commit is contained in:
1 parent
dc238213c5
commit
506d3c4cf8
7 files changed
+107
-277
No files matched your search
+20
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user