Improved special character handling in manticore and URL query.
This commit is contained in:
@@ -8,6 +8,7 @@ import { fetchActorsById, curateActor, sortActorsByGender } from './actors.js';
|
||||
import { fetchTagsById } from './tags.js';
|
||||
import { fetchEntitiesById } from './entities.js';
|
||||
import { curateStash } from './stashes.js';
|
||||
import escape from '../utils/escape-manticore.js';
|
||||
import promiseProps from '../utils/promise-props.js';
|
||||
|
||||
function curateMedia(media) {
|
||||
@@ -428,7 +429,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
}
|
||||
|
||||
if (filters.query) {
|
||||
builder.whereRaw('match(\'@!title :query:\', scenes)', { query: filters.query });
|
||||
builder.whereRaw('match(\'@!title :query:\', scenes)', { query: escape(filters.query) });
|
||||
}
|
||||
|
||||
filters.tagIds?.forEach((tagId) => {
|
||||
@@ -492,8 +493,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
}
|
||||
})
|
||||
.limit(options.limit)
|
||||
.offset((options.page - 1) * options.limit)
|
||||
.toString(),
|
||||
.offset((options.page - 1) * options.limit),
|
||||
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
|
||||
actorsFacet: options.aggregateActors ? knex.raw('facet scenes.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||
tagsFacet: options.aggregateTags ? knex.raw('facet scenes.tag_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||
|
||||
Reference in New Issue
Block a user