Update match all books to load items from DB, remove library items loading to memory on init

This commit is contained in:
advplyr committed 2023-09-04 16:33:55 -05:00
1 parent 03115e5e53
commit 1dd1fe8994
19 files changed
+127 -140

No files matched your search

+2 -1
View File
@@ -118,12 +118,13 @@ class LibraryItem extends Model {
* @param {number} limit
* @returns {Promise<Model<LibraryItem>[]>} LibraryItem
*/
static getLibraryItemsIncrement(offset, limit) {
static getLibraryItemsIncrement(offset, limit, where = null) {
return this.findAll({
benchmark: true,
logging: (sql, timeMs) => {
console.log(`[Query] Elapsed ${timeMs}ms.`)
},
where,
include: [
{
model: this.sequelize.models.book,