Improved release detail bar behavior.

This commit is contained in:
2020-07-01 00:25:27 +02:00
parent 240f53047d
commit 53870fda89
18 changed files with 195 additions and 1136 deletions

View File

@@ -51,7 +51,7 @@ async function attachChannelEntities(releases) {
const channelEntities = await knex('entities')
.select(knex.raw('entities.*, row_to_json(parents) as parent'))
.whereIn('entities.slug', releasesWithoutEntity.map(release => release.channel))
.where('entities.type', 2)
.where('entities.type', 'channel')
.leftJoin('entities AS parents', 'parents.id', 'entities.parent_id');
const channelEntitiesBySlug = channelEntities.reduce((acc, entity) => ({ ...acc, [entity.slug]: entity }), {});
@@ -84,7 +84,7 @@ async function attachStudios(releases) {
const studios = await knex('entities')
.whereIn('slug', studioSlugs)
.where('type', 3);
.where('type', 'studio');
const studioBySlug = studios.reduce((acc, studio) => ({ ...acc, [studio.slug]: studio }), {});