From e0954eb3e884f15e313c06a4b31a03bd64e001c1 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Fri, 22 Nov 2024 21:12:25 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixing=20the=20response=20from?= =?UTF-8?q?=20searchResultAdded=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/comicprocessor.service.ts | 34 ++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/services/comicprocessor.service.ts b/services/comicprocessor.service.ts index 5abf17d..89a1211 100644 --- a/services/comicprocessor.service.ts +++ b/services/comicprocessor.service.ts @@ -122,10 +122,10 @@ export default class ComicProcessorService extends Service { await this.broker.call("socket.search", { query: dcppSearchQuery, config: { - hostname: "192.168.1.119:5600", + hostname: "localhost:5600", protocol: "http", - username: "admin", - password: "password", + username: "user", + password: "pass", }, namespace: "/automated", }); @@ -247,21 +247,19 @@ export default class ComicProcessorService extends Service { }); // Handle searchResultAdded event - this.socketIOInstance.on( - "searchResultAdded", - ({ groupedResult, instanceId }: SearchResultPayload) => { - this.logger.info( - "Received search result added:", - JSON.stringify(groupedResult, null, 4), - ); - if (!this.airDCPPSearchResults.has(instanceId)) { - this.airDCPPSearchResults.set(instanceId, []); - } - if (!isUndefined(groupedResult?.result)) { - this.airDCPPSearchResults.get(instanceId).push(groupedResult.result); - } - }, - ); + this.socketIOInstance.on("searchResultAdded", ({ result }: SearchResult) => { + console.log(result); + this.logger.info( + "AirDC++ Search result added:", + JSON.stringify(result, null, 4), + ); + // if (!this.airDCPPSearchResults.has(instanceId)) { + // this.airDCPPSearchResults.set(instanceId, []); + // } + // if (!isUndefined(groupedResult?.result)) { + // this.airDCPPSearchResults.get(instanceId).push(groupedResult.result); + // } + }); // Handle searchResultUpdated event this.socketIOInstance.on(