Fixed Whale Member posters and photos.
This commit is contained in:
@@ -67,7 +67,7 @@ function withRelations(queryBuilder, withMedia = false, type = 'scene') {
|
||||
row_to_json(sites) as site,
|
||||
row_to_json(networks) as network,
|
||||
row_to_json(site_networks) as site_network,
|
||||
json_agg(DISTINCT actors) as actors
|
||||
COALESCE(json_agg(DISTINCT actors) FILTER (WHERE actors.id IS NOT NULL), '[]') as actors
|
||||
`))
|
||||
.where('type', type)
|
||||
.leftJoin('sites', 'sites.id', 'releases.site_id')
|
||||
@@ -84,7 +84,7 @@ function withRelations(queryBuilder, withMedia = false, type = 'scene') {
|
||||
queryBuilder
|
||||
.select(knex.raw(`
|
||||
row_to_json(posters) as poster,
|
||||
json_agg(DISTINCT photos) as photos
|
||||
COALESCE(json_agg(DISTINCT photos) FILTER (WHERE photos.id IS NOT NULL), '[]') as photos
|
||||
`))
|
||||
.leftJoin('releases_posters', 'releases_posters.release_id', 'releases.id')
|
||||
.leftJoin('media as posters', 'posters.id', 'releases_posters.media_id')
|
||||
|
||||
Reference in New Issue
Block a user