mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 17:04:58 +02:00
Updates to migrate off of old library model
This commit is contained in:
parent
5d13faef33
commit
159ccd807f
11 changed files with 141 additions and 133 deletions
|
@ -11,8 +11,6 @@ const LibraryFile = require('../objects/files/LibraryFile')
|
|||
const Book = require('./Book')
|
||||
const Podcast = require('./Podcast')
|
||||
|
||||
const ShareManager = require('../managers/ShareManager')
|
||||
|
||||
/**
|
||||
* @typedef LibraryFileObject
|
||||
* @property {string} ino
|
||||
|
@ -559,14 +557,14 @@ class LibraryItem extends Model {
|
|||
|
||||
/**
|
||||
* Get library items using filter and sort
|
||||
* @param {oldLibrary} library
|
||||
* @param {import('./Library')} library
|
||||
* @param {import('./User')} user
|
||||
* @param {object} options
|
||||
* @returns {{ libraryItems:oldLibraryItem[], count:number }}
|
||||
*/
|
||||
static async getByFilterAndSort(library, user, options) {
|
||||
let start = Date.now()
|
||||
const { libraryItems, count } = await libraryFilters.getFilteredLibraryItems(library, user, options)
|
||||
const { libraryItems, count } = await libraryFilters.getFilteredLibraryItems(library.id, user, options)
|
||||
Logger.debug(`Loaded ${libraryItems.length} of ${count} items for libary page in ${((Date.now() - start) / 1000).toFixed(2)}s`)
|
||||
|
||||
return {
|
||||
|
@ -602,7 +600,7 @@ class LibraryItem extends Model {
|
|||
|
||||
/**
|
||||
* Get home page data personalized shelves
|
||||
* @param {oldLibrary} library
|
||||
* @param {import('./Library')} library
|
||||
* @param {import('./User')} user
|
||||
* @param {string[]} include
|
||||
* @param {number} limit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue