forked from DebaucheryLibrarian/traxxx
Using summaries table for improved performance.
This commit is contained in:
@@ -234,10 +234,12 @@ async function fetchEntitiesBySlug(entitySlugs, prefer = 'channel') {
|
||||
ORDER BY entity->'type' :sort;
|
||||
`, {
|
||||
entitySlugs: entitySlugs.filter((slug) => !slug.includes('.')),
|
||||
entityHosts: entitySlugs.filter((slug) => slug.includes('.')).map((hostname) => `%${hostname}%`),
|
||||
entityHosts: entitySlugs.filter((slug) => slug.includes('.')).map((hostname) => `%${hostname}`),
|
||||
sort: knex.raw(prefer === 'channel' ? 'asc' : 'desc'),
|
||||
});
|
||||
|
||||
console.log(entities.rows);
|
||||
|
||||
// channel entity will overwrite network entity
|
||||
const entitiesBySlug = entities.rows.reduce((accEntities, { entity }) => {
|
||||
const host = urlToHostname(entity.url);
|
||||
|
||||
Reference in New Issue
Block a user