forked from DebaucheryLibrarian/traxxx
Updated dependencies. Added periodic memory logger.
This commit is contained in:
@@ -46,7 +46,7 @@ function curateEntity(entity, includeParameters = false) {
|
||||
} : {};
|
||||
|
||||
if (entity.tags) {
|
||||
curatedEntity.tags = entity.tags.map(tag => ({
|
||||
curatedEntity.tags = entity.tags.map((tag) => ({
|
||||
id: tag.id,
|
||||
name: tag.name,
|
||||
slug: tag.slug,
|
||||
@@ -59,14 +59,14 @@ function curateEntity(entity, includeParameters = false) {
|
||||
}
|
||||
|
||||
if (entity.children) {
|
||||
curatedEntity.children = entity.children.map(child => curateEntity({
|
||||
curatedEntity.children = entity.children.map((child) => curateEntity({
|
||||
...child,
|
||||
parent: curatedEntity.id ? curatedEntity : null,
|
||||
}, includeParameters));
|
||||
}
|
||||
|
||||
if (entity.included_children) {
|
||||
curatedEntity.includedChildren = entity.included_children.map(child => curateEntity({
|
||||
curatedEntity.includedChildren = entity.included_children.map((child) => curateEntity({
|
||||
...child,
|
||||
parent: curatedEntity.id ? curatedEntity : null,
|
||||
}, includeParameters));
|
||||
@@ -79,7 +79,7 @@ function curateEntity(entity, includeParameters = false) {
|
||||
}
|
||||
|
||||
async function curateEntities(entities, includeParameters) {
|
||||
return Promise.all(entities.map(async entity => curateEntity(entity, includeParameters)));
|
||||
return Promise.all(entities.map(async (entity) => curateEntity(entity, includeParameters)));
|
||||
}
|
||||
|
||||
function urlToSiteSlug(url) {
|
||||
@@ -102,8 +102,8 @@ async function fetchIncludedEntities() {
|
||||
includeAll: !argv.networks && !argv.channels && !config.include?.networks && !config.include?.channels,
|
||||
includedNetworks: argv.networks || (!argv.channels && config.include?.networks) || [],
|
||||
includedChannels: argv.channels || (!argv.networks && config.include?.channels) || [],
|
||||
excludedNetworks: argv.excludeNetworks || config.exclude?.networks.filter(network => !argv.networks?.includes(network)) || [], // ignore explicitly included networks
|
||||
excludedChannels: argv.excludeChannels || config.exclude?.channels.filter(channel => !argv.channels?.includes(channel)) || [], // ignore explicitly included channels
|
||||
excludedNetworks: argv.excludeNetworks || config.exclude?.networks.filter((network) => !argv.networks?.includes(network)) || [], // ignore explicitly included networks
|
||||
excludedChannels: argv.excludeChannels || config.exclude?.channels.filter((channel) => !argv.channels?.includes(channel)) || [], // ignore explicitly included channels
|
||||
};
|
||||
|
||||
const rawNetworks = await knex.raw(`
|
||||
@@ -228,11 +228,11 @@ async function fetchEntitiesBySlug(entitySlugs, sort = 'asc') {
|
||||
}
|
||||
|
||||
async function fetchReleaseEntities(baseReleases) {
|
||||
const baseReleasesWithoutEntity = baseReleases.filter(release => release.url && !release.site && !release.entity);
|
||||
const baseReleasesWithoutEntity = baseReleases.filter((release) => release.url && !release.site && !release.entity);
|
||||
|
||||
const entitySlugs = Array.from(new Set(
|
||||
baseReleasesWithoutEntity
|
||||
.map(baseRelease => urlToSiteSlug(baseRelease.url))
|
||||
.map((baseRelease) => urlToSiteSlug(baseRelease.url))
|
||||
.filter(Boolean),
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user