🔧 Fixing broken AirDCPP search

This commit is contained in:
2024-09-26 21:33:02 -04:00
parent 402ee4d81b
commit f9438f2129
3 changed files with 106 additions and 4 deletions

View File

@@ -551,7 +551,8 @@ export default class ImportService extends Service {
params: { id: "string" },
async handler(ctx: Context<{ id: string }>) {
console.log(ctx.params.id);
return await Comic.findById(ctx.params.id);
return await Comic.findById(new ObjectId(ctx.params.id));
},
},
getComicBooksByIds: {

View File

@@ -125,12 +125,9 @@ export default class SocketService extends Service {
config: "object",
},
async handler(ctx) {
console.log("a, a kanha kanha...");
const { query, config, namespace } = ctx.params;
const namespacedInstance = this.io.of(namespace || "/");
const ADCPPSocket = new AirDCPPSocket(config);
console.log("asdas", ADCPPSocket);
try {
await ADCPPSocket.connect();
const instance = await ADCPPSocket.post(
@@ -148,6 +145,7 @@ export default class SocketService extends Service {
`search`,
`search_result_added`,
(groupedResult) => {
console.log(JSON.stringify(groupedResult, null, 4));
namespacedInstance.emit(
"searchResultAdded",
groupedResult