1 Commits

Author SHA1 Message Date
0f47750bc2 Merge branch 'master' into automated-download-loop 2024-10-23 14:27:44 -04:00
2 changed files with 1197 additions and 856 deletions

2033
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -768,21 +768,19 @@ export default class LibraryService extends Service {
new ObjectId(ctx.params.comicObjectId) new ObjectId(ctx.params.comicObjectId)
); );
// 2. Init AirDC++ // 2. Init AirDC++
const ADCPPSocket = new AirDCPPSocket(config);
await ADCPPSocket.connect();
// 3. Get the bundles for the comic object // 3. Get the bundles for the comic object
const ADCPPSocket = new AirDCPPSocket(config);
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
const bundles = return comicObject.acquisition.directconnect.downloads.map(
comicObject.acquisition.directconnect.downloads.map( async (bundle) =>
async (bundle) => { await ADCPPSocket.get(
return await ADCPPSocket.get( `queue/bundles/${bundle.id}`
`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++",