Compare commits
2 Commits
edb4be379f
...
66c1cbab6a
| Author | SHA1 | Date |
|---|---|---|
|
|
66c1cbab6a | |
|
|
34348890ec |
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "traxxx-web",
|
||||
"version": "0.42.15",
|
||||
"version": "0.42.16",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.42.15",
|
||||
"version": "0.42.16",
|
||||
"dependencies": {
|
||||
"@brillout/json-serializer": "^0.5.8",
|
||||
"@dicebear/collection": "^7.0.5",
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
"overrides": {
|
||||
"vite": "$vite"
|
||||
},
|
||||
"version": "0.42.15",
|
||||
"version": "0.42.16",
|
||||
"imports": {
|
||||
"#/*": "./*.js"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,14 +194,22 @@ export async function fetchScenesById(sceneIds, { reqUser, ...context } = {}) {
|
|||
'networks.name as network_name',
|
||||
'networks.type as network_type',
|
||||
'networks.has_logo as network_has_logo',
|
||||
knex.raw('row_to_json(coalesce(channel_affiliates, network_affiliates)) as affiliate'),
|
||||
knex.raw('row_to_json(affiliates) as affiliate'),
|
||||
)
|
||||
.whereIn('releases.id', sceneIds)
|
||||
.leftJoin('entities as channels', 'channels.id', 'releases.entity_id')
|
||||
.leftJoin('entities as networks', 'networks.id', 'channels.parent_id')
|
||||
.leftJoin('affiliates as channel_affiliates', 'channel_affiliates.entity_id', 'channels.id')
|
||||
.leftJoin('affiliates as network_affiliates', 'network_affiliates.entity_id', 'networks.id')
|
||||
.groupBy('channels.id', 'networks.id', 'channel_affiliates.id', 'network_affiliates.id'),
|
||||
// .leftJoin('affiliates as channel_affiliates', 'channel_affiliates.entity_id', 'channels.id')
|
||||
// .leftJoin('affiliates as network_affiliates', 'network_affiliates.entity_id', 'networks.id')
|
||||
.joinRaw(`
|
||||
left join lateral (
|
||||
select *
|
||||
from affiliates
|
||||
where affiliates.entity_id in (channels.id, networks.id)
|
||||
order by (affiliates.entity_id = channels.id) desc
|
||||
limit 1
|
||||
) affiliates ON TRUE
|
||||
`),
|
||||
studios: knex('releases')
|
||||
.whereIn('releases.id', sceneIds)
|
||||
.leftJoin('entities as studios', 'studios.id', 'releases.studio_id'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue