Optionally showing aliases in actors admin.
This commit is contained in:
@@ -396,9 +396,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
.innerJoin('actors', 'actors.id', 'actors_stashed.actor_id')
|
||||
.where('stash_id', filters.stashId);
|
||||
} else {
|
||||
builder
|
||||
.select(knex.raw('*, weight() as _score'))
|
||||
.where('alias_for', 0);
|
||||
builder.select(knex.raw('*, weight() as _score'));
|
||||
}
|
||||
|
||||
if (filters.query) {
|
||||
@@ -409,7 +407,13 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
}
|
||||
}
|
||||
|
||||
if (filters.isGlobal) {
|
||||
console.log('FILTERS', filters);
|
||||
|
||||
if (!filters.includeAliased) {
|
||||
builder.where('alias_for', 0);
|
||||
}
|
||||
|
||||
if (filters.requireGlobal) {
|
||||
builder.where('entity_id', 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ export function curateActorsQuery(query) {
|
||||
weight: query.weight?.split(',').map((weight) => Number(weight)),
|
||||
requireAvatar: query.avatar,
|
||||
stashId: Number(query.stashId) || null,
|
||||
isGlobal: !!query.global,
|
||||
isGlobal: Object.hasOwn(query, 'global'),
|
||||
includeAliased: Object.hasOwn(query, 'alias'),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user