Entity refactor. Facilitating channels without parent.
This commit is contained in:
@@ -165,7 +165,7 @@ async function scrapeChannelReleases(scraper, channelEntity, preData) {
|
||||
: [],
|
||||
]);
|
||||
|
||||
logger.info(`Fetching ${latestReleases.length} latest and ${upcomingReleases.length} upcoming updates for '${channelEntity.name}' (${channelEntity.parent.name})`);
|
||||
logger.info(`Fetching ${latestReleases.length} latest and ${upcomingReleases.length} upcoming updates for '${channelEntity.name}' (${channelEntity.parent?.name})`);
|
||||
|
||||
return [...latestReleases, ...upcomingReleases];
|
||||
}
|
||||
@@ -176,7 +176,7 @@ async function scrapeChannel(channelEntity, accNetworkReleases) {
|
||||
|| scrapers.releases[channelEntity.parent?.parent?.slug];
|
||||
|
||||
if (!scraper) {
|
||||
logger.warn(`No scraper found for '${channelEntity.name}' (${channelEntity.parent.name})`);
|
||||
logger.warn(`No scraper found for '${channelEntity.name}' (${channelEntity.parent?.name})`);
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ async function scrapeNetworkSequential(networkEntity) {
|
||||
networkEntity.children,
|
||||
async (chain, channelEntity) => {
|
||||
const accNetworkReleases = await chain;
|
||||
const channelReleases = await scrapeChannel(channelEntity, networkEntity, accNetworkReleases);
|
||||
const channelReleases = await scrapeChannel(channelEntity, accNetworkReleases);
|
||||
|
||||
return accNetworkReleases.concat(channelReleases);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user