Поправка
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
|
|
||||||
const maxMemCacheSize = 100;
|
const maxMemCacheSize = 100;
|
||||||
|
const maxLimit = 1000;
|
||||||
|
|
||||||
const emptyFieldValue = '?';
|
const emptyFieldValue = '?';
|
||||||
const maxUtf8Char = String.fromCodePoint(0xFFFFF);
|
const maxUtf8Char = String.fromCodePoint(0xFFFFF);
|
||||||
@@ -281,18 +282,7 @@ class DbSearcher {
|
|||||||
const seriesRows = await db.select({
|
const seriesRows = await db.select({
|
||||||
table: 'series',
|
table: 'series',
|
||||||
rawResult: true,
|
rawResult: true,
|
||||||
where: `
|
where: `return Array.from(${where})`,
|
||||||
const ids = ${where};
|
|
||||||
|
|
||||||
const result = new Set();
|
|
||||||
for (const id of ids) {
|
|
||||||
const row = @unsafeRow(id);
|
|
||||||
for (const authorId of row.authorId)
|
|
||||||
result.add(authorId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Array.from(result);
|
|
||||||
`
|
|
||||||
});
|
});
|
||||||
|
|
||||||
seriesIds = seriesRows[0].rawResult;
|
seriesIds = seriesRows[0].rawResult;
|
||||||
@@ -408,7 +398,7 @@ class DbSearcher {
|
|||||||
|
|
||||||
const totalFound = authorIds.length;
|
const totalFound = authorIds.length;
|
||||||
let limit = (query.limit ? query.limit : 100);
|
let limit = (query.limit ? query.limit : 100);
|
||||||
limit = (limit > 1000 ? 1000 : limit);
|
limit = (limit > maxLimit ? maxLimit : limit);
|
||||||
const offset = (query.offset ? query.offset : 0);
|
const offset = (query.offset ? query.offset : 0);
|
||||||
|
|
||||||
//выборка найденных авторов
|
//выборка найденных авторов
|
||||||
@@ -445,7 +435,7 @@ class DbSearcher {
|
|||||||
|
|
||||||
const totalFound = seriesIds.length;
|
const totalFound = seriesIds.length;
|
||||||
let limit = (query.limit ? query.limit : 100);
|
let limit = (query.limit ? query.limit : 100);
|
||||||
limit = (limit > 1000 ? 1000 : limit);
|
limit = (limit > maxLimit ? maxLimit : limit);
|
||||||
const offset = (query.offset ? query.offset : 0);
|
const offset = (query.offset ? query.offset : 0);
|
||||||
|
|
||||||
//выборка найденных авторов
|
//выборка найденных авторов
|
||||||
|
|||||||
Reference in New Issue
Block a user