diff --git a/.gitignore b/.gitignore index c4e6a9d..b2900c9 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ typings/ dist/ .vscode userdata +.DS_Store diff --git a/services/comicvine.service.ts b/services/comicvine.service.ts index 72f072a..0ca86e4 100644 --- a/services/comicvine.service.ts +++ b/services/comicvine.service.ts @@ -95,7 +95,7 @@ export default class ComicVineService extends Service { filter: `volume:${comicBookDetails.sourcedMetadata.comicvine.volumeInformation.id}`, }, headers: { - "Accept": "application/json", + Accept: "application/json", "User-Agent": "ThreeTwo", }, }); @@ -192,7 +192,7 @@ export default class ComicVineService extends Service { ); const results: any = []; console.log( - "passed to fetchvolumesfromcv", + "passed to fetchVolumesFromCV", ctx.params ); const volumes = await this.fetchVolumesFromCV( @@ -254,7 +254,7 @@ export default class ComicVineService extends Service { filter: filterString, }, headers: { - "Accept": "application/json", + Accept: "application/json", "User-Agent": "ThreeTwo", }, }); @@ -315,7 +315,7 @@ export default class ComicVineService extends Service { resources, }, headers: { - "Accept": "application/json", + Accept: "application/json", "User-Agent": "ThreeTwo", }, }); @@ -335,11 +335,24 @@ export default class ComicVineService extends Service { output.push(...data.results); currentPage += 1; // Params.page = currentPage; + console.log( `Fetching results for page ${currentPage} (of ${ totalPages + 1 })...` ); + + await this.broker.call("socket.broadcast", { + namespace: "/", + event: "CV_SCRAPING_STATUS", + args: [ + { + message: `Fetching results for page ${currentPage} (of ${ + totalPages + 1 + })...`, + }, + ], + }); return await this.fetchVolumesFromCV( { format,