Compare commits
23 Commits
automated-
...
ux-refinem
| Author | SHA1 | Date | |
|---|---|---|---|
| 1dad0cfd7e | |||
| 1d48499c64 | |||
| c9ecbb911a | |||
| 30168844f3 | |||
| 2e60e2e3d5 | |||
| 8254ec2093 | |||
| 7381d03045 | |||
| 2247411ac8 | |||
| e61ecb1143 | |||
| e01421f17b | |||
| cc271021e0 | |||
| cc772504ae | |||
| 8dcb17a6a0 | |||
| a06896ffcc | |||
| 03f6623ed0 | |||
| 66f9d63b44 | |||
| a936df3144 | |||
| dc9dabca48 | |||
| 4680fd0875 | |||
| 323548c0ff | |||
| f4563c12c6 | |||
| 1b0cada848 | |||
| 750a74cd9f |
2235
package-lock.json
generated
2235
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -792,19 +792,21 @@ export default class ImportService extends Service {
|
|||||||
new ObjectId(ctx.params.comicObjectId)
|
new ObjectId(ctx.params.comicObjectId)
|
||||||
);
|
);
|
||||||
// 2. Init AirDC++
|
// 2. Init AirDC++
|
||||||
// 3. Get the bundles for the comic object
|
|
||||||
const ADCPPSocket = new AirDCPPSocket(config);
|
const ADCPPSocket = new AirDCPPSocket(config);
|
||||||
|
await ADCPPSocket.connect();
|
||||||
|
// 3. Get the bundles for the comic object
|
||||||
if (comicObject) {
|
if (comicObject) {
|
||||||
// make the call to get the bundles from AirDC++ using the bundleId
|
// make the call to get the bundles from AirDC++ using the bundleId
|
||||||
return comicObject.acquisition.directconnect.downloads.map(
|
const bundles =
|
||||||
async (bundle) =>
|
comicObject.acquisition.directconnect.downloads.map(
|
||||||
await ADCPPSocket.get(
|
async (bundle) => {
|
||||||
`queue/bundles/${bundle.id}`
|
return await ADCPPSocket.get(
|
||||||
)
|
`queue/bundles/${bundle.bundleId}`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.all(bundles);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Errors.MoleculerError(
|
throw new Errors.MoleculerError(
|
||||||
"Couldn't fetch bundles from AirDC++",
|
"Couldn't fetch bundles from AirDC++",
|
||||||
|
|||||||
@@ -127,9 +127,10 @@ export default class SocketService extends Service {
|
|||||||
await ADCPPSocket.addListener(
|
await ADCPPSocket.addListener(
|
||||||
`search`,
|
`search`,
|
||||||
`search_result_added`,
|
`search_result_added`,
|
||||||
(groupedResult) => {
|
(groupedResult, entityId: number) => {
|
||||||
console.log(JSON.stringify(groupedResult, null, 4));
|
namespacedInstance.emit("searchResultAdded", {
|
||||||
namespacedInstance.emit("searchResultAdded", groupedResult);
|
groupedResult: { entityId, payload: groupedResult?.result },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
instance.id
|
instance.id
|
||||||
);
|
);
|
||||||
@@ -137,8 +138,10 @@ export default class SocketService extends Service {
|
|||||||
await ADCPPSocket.addListener(
|
await ADCPPSocket.addListener(
|
||||||
`search`,
|
`search`,
|
||||||
`search_result_updated`,
|
`search_result_updated`,
|
||||||
(updatedResult) => {
|
(updatedResult, entityId: number) => {
|
||||||
namespacedInstance.emit("searchResultUpdated", updatedResult);
|
namespacedInstance.emit("searchResultUpdated", {
|
||||||
|
updatedResult: { entityId, payload: updatedResult?.result },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
instance.id
|
instance.id
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user