From 013cccaac599e7aa8f9a46b6fce55196adc4911e Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 10 Mar 2026 16:43:49 +0000 Subject: [PATCH] add more logging for discord now playing update logic --- src/backend/scrobblers/DiscordScrobbler.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/scrobblers/DiscordScrobbler.ts b/src/backend/scrobblers/DiscordScrobbler.ts index e8043bf1..0fb06d8a 100644 --- a/src/backend/scrobblers/DiscordScrobbler.ts +++ b/src/backend/scrobblers/DiscordScrobbler.ts @@ -163,20 +163,28 @@ export default class DiscordScrobbler extends AbstractScrobbleClient { const [sendOk, reasons, level = 'warn'] = await this.api.checkOkToSend(); if (!sendOk) { - this.logger[level](`Cannot update playing now because api client is ${reasons}`); + this.npLogger[level](`Cannot update playing now because api client is ${reasons}`); return false; } if(this.api instanceof DiscordWSClient) { const [allowed, reason] = this.api.presenceIsAllowed(); if(!allowed) { - this.logger.debug(reason); + this.npLogger.debug(reason); } return true; } return true; + } else { + if(!data.nowPlayingMode && ![CALCULATED_PLAYER_STATUSES.stopped, CALCULATED_PLAYER_STATUSES.paused, CALCULATED_PLAYER_STATUSES.playing].includes(data.status.calculated as ReportedPlayerStatus)) { + this.npLogger.trace(`Will not update because player is not in state: stopped | paused | playing => Found '${data.status.calculated }'`); + } else if(data.nowPlayingMode && CALCULATED_PLAYER_STATUSES.stopped) { + this.npLogger.trace(`Will not update because now playing player is stopped => Found ${data.status.calculated}`); + } else { + this.npLogger.trace('Will not update because now player is in an unexpected state for discord usage'); + } } } } -- 2.51.2