🔧 Fixing the response from searchResultAdded event
This commit is contained in:
@@ -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(
|
"AirDC++ Search result added:",
|
||||||
"Received search result added:",
|
JSON.stringify(result, null, 4),
|
||||||
JSON.stringify(groupedResult, null, 4),
|
);
|
||||||
);
|
// if (!this.airDCPPSearchResults.has(instanceId)) {
|
||||||
if (!this.airDCPPSearchResults.has(instanceId)) {
|
// this.airDCPPSearchResults.set(instanceId, []);
|
||||||
this.airDCPPSearchResults.set(instanceId, []);
|
// }
|
||||||
}
|
// if (!isUndefined(groupedResult?.result)) {
|
||||||
if (!isUndefined(groupedResult?.result)) {
|
// this.airDCPPSearchResults.get(instanceId).push(groupedResult.result);
|
||||||
this.airDCPPSearchResults.get(instanceId).push(groupedResult.result);
|
// }
|
||||||
}
|
});
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// Handle searchResultUpdated event
|
// Handle searchResultUpdated event
|
||||||
this.socketIOInstance.on(
|
this.socketIOInstance.on(
|
||||||
|
|||||||
Reference in New Issue
Block a user