Adding scraper config by scraper slug to current 'includes' parameter.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const config = require('config');
|
||||
const Promise = require('bluebird');
|
||||
const moment = require('moment');
|
||||
|
||||
@@ -93,9 +94,14 @@ function needNextPage(pageReleases, accReleases, isUpcoming) {
|
||||
|
||||
async function scrapeReleases(scraper, entity, preData, isUpcoming) {
|
||||
async function scrapeReleasesPage(page, accReleases) {
|
||||
const options = {
|
||||
...config.options[scraper.slug],
|
||||
...include,
|
||||
};
|
||||
|
||||
const pageReleases = isUpcoming
|
||||
? await scraper.fetchUpcoming(entity, page, include, preData)
|
||||
: await scraper.fetchLatest(entity, page, include, preData);
|
||||
? await scraper.fetchUpcoming(entity, page, options, preData)
|
||||
: await scraper.fetchLatest(entity, page, options, preData);
|
||||
|
||||
if (!Array.isArray(pageReleases)) {
|
||||
// scraper is unable to fetch the releases and returned a HTTP code or null
|
||||
|
||||
Reference in New Issue
Block a user