🔧 Fixing the response from searchResultAdded event

This commit is contained in:
2024-11-22 21:12:25 -05:00
parent 651e3ac7bb
commit e0954eb3e8

View File

@@ -122,10 +122,10 @@ export default class ComicProcessorService extends Service {
await this.broker.call("socket.search", { await this.broker.call("socket.search", {
query: dcppSearchQuery, query: dcppSearchQuery,
config: { config: {
hostname: "192.168.1.119:5600", hostname: "localhost:5600",
protocol: "http", protocol: "http",
username: "admin", username: "user",
password: "password", password: "pass",
}, },
namespace: "/automated", namespace: "/automated",
}); });
@@ -247,21 +247,19 @@ export default class ComicProcessorService extends Service {
}); });
// Handle searchResultAdded event // Handle searchResultAdded event
this.socketIOInstance.on( this.socketIOInstance.on("searchResultAdded", ({ result }: SearchResult) => {
"searchResultAdded", console.log(result);
({ groupedResult, instanceId }: SearchResultPayload) => {
this.logger.info( this.logger.info(
"Received search result added:", "AirDC++ Search result added:",
JSON.stringify(groupedResult, null, 4), 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);
}
},
); );
// if (!this.airDCPPSearchResults.has(instanceId)) {
// this.airDCPPSearchResults.set(instanceId, []);
// }
// if (!isUndefined(groupedResult?.result)) {
// this.airDCPPSearchResults.get(instanceId).push(groupedResult.result);
// }
});
// Handle searchResultUpdated event // Handle searchResultUpdated event
this.socketIOInstance.on( this.socketIOInstance.on(