From 44424f257074ebd358811cb76899b3f845d308c7 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Wed, 3 Jun 2026 13:24:10 +0000 Subject: [PATCH] fix: more logging and arg fixes after re-generating lock file --- src/backend/common/vendor/maloja/MalojaApiClient.ts | 4 ++-- src/backend/notifier/AppriseWebhookNotifier.ts | 2 +- src/backend/server/auth.ts | 2 +- src/backend/sources/DeezerSource.ts | 2 +- src/backend/sources/SpotifySource.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/common/vendor/maloja/MalojaApiClient.ts b/src/backend/common/vendor/maloja/MalojaApiClient.ts index 4682f1a7..19186c74 100644 --- a/src/backend/common/vendor/maloja/MalojaApiClient.ts +++ b/src/backend/common/vendor/maloja/MalojaApiClient.ts @@ -168,11 +168,11 @@ export class MalojaApiClient extends AbstractApiClient implements PaginatedTimeR this.logger.info('Auth test passed!'); return true; } else { - this.logger.error('Maloja API Response', { + this.logger.error({ status, body, text: text.slice(0, 50) - }); + },'Maloja API Response'); throw new Error('Server Response body was malformed -- should have returned "status: ok"...is the URL correct?', { cause: new Error(`Maloja API Response was ${status}: ${text.slice(0, 50)}`) }) } } catch (e) { diff --git a/src/backend/notifier/AppriseWebhookNotifier.ts b/src/backend/notifier/AppriseWebhookNotifier.ts index f9dbb8bb..0034970b 100644 --- a/src/backend/notifier/AppriseWebhookNotifier.ts +++ b/src/backend/notifier/AppriseWebhookNotifier.ts @@ -121,7 +121,7 @@ export class AppriseWebhookNotifier extends AbstractWebhookNotifier { anyOk = true; this.logger.verbose(`Pushed notification to URLs`); } catch (e: any) { - this.logger.warn(`Failed to push notification for '${payload.title}' to URLs`, {cause: e}); + this.logger.warn(new Error(`Failed to push notification for '${payload.title}' to URLs`, {cause: e})); if(isDebugMode()) { this.logger.debug({ body }, 'Apprise Request') } diff --git a/src/backend/server/auth.ts b/src/backend/server/auth.ts index 139e66ba..2b706363 100644 --- a/src/backend/server/auth.ts +++ b/src/backend/server/auth.ts @@ -141,7 +141,7 @@ export const setupAuthRoutes = (app: Express, logger: Logger, sourceMiddle: Expr // TODO right now all sources requiring source interaction are covered by logic branches (deezer above and spotify here) // but eventually should update all source callbacks to url specific URLS to avoid ambiguity... // wish we could use state param to identify name/source but not all auth strategies and auth provides may provide access to that - logger.info('Received auth code callback from Spotify', {label: 'Spotify'}); + logger.info({label: 'Spotify'}, 'Received auth code callback from Spotify'); const source = scrobbleSources.getByNameAndType(state as string, 'spotify', true) as SpotifySource; const tokenResult = await source.handleAuthCodeCallback(req.query); let responseContent = 'OK'; diff --git a/src/backend/sources/DeezerSource.ts b/src/backend/sources/DeezerSource.ts index 9a37def2..d47a9e91 100644 --- a/src/backend/sources/DeezerSource.ts +++ b/src/backend/sources/DeezerSource.ts @@ -202,7 +202,7 @@ export default class DeezerSource extends AbstractSource { } = e; const msg = response !== undefined ? `API Call failed: Server Response => ${ssMessage}` : `API Call failed: ${message}`; const responseMeta = ssResp ?? text; - this.logger.error(msg, {status, response: responseMeta}); + this.logger.error({status, response: responseMeta}, msg); throw e; } } diff --git a/src/backend/sources/SpotifySource.ts b/src/backend/sources/SpotifySource.ts index f014164f..c66b8c0f 100644 --- a/src/backend/sources/SpotifySource.ts +++ b/src/backend/sources/SpotifySource.ts @@ -267,7 +267,7 @@ export default class SpotifySource extends MemoryPositionalSource implements Pag try { spotifyCreds = await readJson(this.workingCredsPath, {throwOnNotFound: false, interpolateEnvs: false}) as any; } catch (e) { - this.logger.warn('Current spotify credentials file exists but could not be parsed', { path: this.workingCredsPath }); + this.logger.warn({ path: this.workingCredsPath }, 'Current spotify credentials file exists but could not be parsed'); } const {token: accessToken = undefined, refreshToken = undefined} = (spotifyCreds || {}) as any; -- 2.51.2