mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-16 16:31:30 +00:00
Merge 4e808e6770 into 47ea6b5092
This commit is contained in:
commit
f3a220c173
26 changed files with 2441 additions and 304 deletions
|
|
@ -9,10 +9,11 @@ const SocketAuthority = require('../SocketAuthority')
|
|||
/**
|
||||
* @typedef EBookFileObject
|
||||
* @property {string} ino
|
||||
* @property {string} deviceId
|
||||
* @property {string} ebookFormat
|
||||
* @property {number} addedAt
|
||||
* @property {number} updatedAt
|
||||
* @property {{filename:string, ext:string, path:string, relPath:strFing, size:number, mtimeMs:number, ctimeMs:number, birthtimeMs:number}} metadata
|
||||
* @property {{filename:string, ext:string, path:string, relPath:string, size:number, mtimeMs:number, ctimeMs:number, birthtimeMs:number}} metadata
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
@ -46,6 +47,7 @@ const SocketAuthority = require('../SocketAuthority')
|
|||
* @typedef AudioFileObject
|
||||
* @property {number} index
|
||||
* @property {string} ino
|
||||
* @property {string} deviceId
|
||||
* @property {{filename:string, ext:string, path:string, relPath:string, size:number, mtimeMs:number, ctimeMs:number, birthtimeMs:number}} metadata
|
||||
* @property {number} addedAt
|
||||
* @property {number} updatedAt
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ const Podcast = require('./Podcast')
|
|||
/**
|
||||
* @typedef LibraryFileObject
|
||||
* @property {string} ino
|
||||
* @property {string} deviceId
|
||||
* @property {boolean} isSupplementary
|
||||
* @property {number} addedAt
|
||||
* @property {number} updatedAt
|
||||
|
|
@ -33,6 +34,8 @@ class LibraryItem extends Model {
|
|||
/** @type {string} */
|
||||
this.ino
|
||||
/** @type {string} */
|
||||
this.deviceId
|
||||
/** @type {string} */
|
||||
this.path
|
||||
/** @type {string} */
|
||||
this.relPath
|
||||
|
|
@ -237,7 +240,7 @@ class LibraryItem extends Model {
|
|||
* @param {import('sequelize').WhereOptions} where
|
||||
* @param {import('sequelize').BindOrReplacements} [replacements]
|
||||
* @param {import('sequelize').IncludeOptions} [include]
|
||||
* @returns {Promise<LibraryItemExpanded>}
|
||||
* @returns {Promise<LibraryItemExpanded | null>}
|
||||
*/
|
||||
static async findOneExpanded(where, replacements = null, include = null) {
|
||||
const libraryItem = await this.findOne({
|
||||
|
|
@ -289,7 +292,7 @@ class LibraryItem extends Model {
|
|||
* @param {import('./Library')} library
|
||||
* @param {import('./User')} user
|
||||
* @param {object} options
|
||||
* @returns {{ libraryItems:Object[], count:number }}
|
||||
* @returns {Promise<{ libraryItems:Object[], count:number }>}
|
||||
*/
|
||||
static async getByFilterAndSort(library, user, options) {
|
||||
let start = Date.now()
|
||||
|
|
@ -728,6 +731,7 @@ class LibraryItem extends Model {
|
|||
primaryKey: true
|
||||
},
|
||||
ino: DataTypes.STRING,
|
||||
deviceId: DataTypes.STRING,
|
||||
path: DataTypes.STRING,
|
||||
relPath: DataTypes.STRING,
|
||||
mediaId: DataTypes.UUID,
|
||||
|
|
@ -752,6 +756,9 @@ class LibraryItem extends Model {
|
|||
sequelize,
|
||||
modelName: 'libraryItem',
|
||||
indexes: [
|
||||
{
|
||||
fields: ['ino', 'deviceId']
|
||||
},
|
||||
{
|
||||
fields: ['createdAt']
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue