Added movies overview page. Fixed channel filter duplicates.
This commit is contained in:
@@ -86,6 +86,24 @@ export async function fetchEntitiesById(entityIds, options = {}) {
|
||||
return curatedEntities;
|
||||
}
|
||||
|
||||
export async function getEntityIdsBySlug(slugs, domain) {
|
||||
const ids = await Promise.all(slugs.map(async (slug) => {
|
||||
if (!slug) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Number(slug)) {
|
||||
return Number(slug); // already an ID or missing
|
||||
}
|
||||
|
||||
const id = await redis.hGet(`traxxx:${domain}:id_by_slug`, slug);
|
||||
|
||||
return Number(id);
|
||||
}));
|
||||
|
||||
return ids.filter(Boolean);
|
||||
}
|
||||
|
||||
export async function cacheEntityIds() {
|
||||
const entities = await knex('entities').select('id', 'slug', 'type');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user