From 22b58c2f89f4b54f19116c962dc8075fc63b5082 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 27 Aug 2026 15:14:53 +0000 Subject: [PATCH] deezer response debug --- src/backend/sources/DeezerInternalSource.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backend/sources/DeezerInternalSource.ts b/src/backend/sources/DeezerInternalSource.ts index d7976a9f..90fdae10 100644 --- a/src/backend/sources/DeezerInternalSource.ts +++ b/src/backend/sources/DeezerInternalSource.ts @@ -210,6 +210,7 @@ export default class DeezerInternalSource extends MemorySource { getRecentlyPlayed = async (options: RecentlyPlayedOptions = {}) => { this.setStatus('Checking for new Plays'); + let resp: DeezerHistoryResponse; try { const req = this.agent.post('https://www.deezer.com/ajax/gw-light.php') .query({ @@ -221,7 +222,7 @@ export default class DeezerInternalSource extends MemorySource { start: 0 }); // returns listening history in descending order (newest to oldest) - const resp = (await this.callApi(req)) as DeezerHistoryResponse; + resp = (await this.callApi(req)) as DeezerHistoryResponse; let errList: string[] = []; if('error' in resp.results) { errList = resp.results.error; @@ -243,6 +244,9 @@ export default class DeezerInternalSource extends MemorySource { } return resp.results.data.filter(x => x.__TYPE__ === 'song').map(x => DeezerInternalSource.formatPlayObj(x)).sort(sortByOldestPlayDate); } catch (e) { + if(resp !== undefined) { + this.logger.debug({body: resp},'Deezer raw body response'); + } throw new Error('Failed to get recently played tracks', {cause: e}); } } @@ -312,6 +316,12 @@ export default class DeezerInternalSource extends MemorySource { const err = new Error((error as string[]).join(' | ')); throw err; } + if(resp.statusCode !== 200) { + this.logger.debug(`Non 200 status code returned: ${resp.statusCode}`); + } + if(!resp.header['Content-Type']?.includes('json')) { + this.logger.debug(`Non json content-type returned: ${resp.header['Content-Type']}`); + } return resp.body; } catch (e) { if(retries < maxRequestRetries) { -- 2.51.2