mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Update jsdoc defs for models
This commit is contained in:
parent
e0dae44c7d
commit
1187f91063
@ -1,11 +1,28 @@
|
||||
const { DataTypes, Model } = require('sequelize')
|
||||
const Logger = require('../Logger')
|
||||
|
||||
/**
|
||||
* @typedef EBookFileObject
|
||||
* @property {string} ino
|
||||
* @property {string} ebookFormat
|
||||
* @property {number} addedAt
|
||||
* @property {number} updatedAt
|
||||
* @property {{filename:string, ext:string, path:string, relPath:string, size:number, mtimeMs:number, ctimeMs:number, birthtimeMs:number}} metadata
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef ChapterObject
|
||||
* @property {number} id
|
||||
* @property {number} start
|
||||
* @property {number} end
|
||||
* @property {string} title
|
||||
*/
|
||||
|
||||
class Book extends Model {
|
||||
constructor(values, options) {
|
||||
super(values, options)
|
||||
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.id
|
||||
/** @type {string} */
|
||||
this.title
|
||||
@ -33,17 +50,17 @@ class Book extends Model {
|
||||
this.coverPath
|
||||
/** @type {number} */
|
||||
this.duration
|
||||
/** @type {Object} */
|
||||
/** @type {string[]} */
|
||||
this.narrators
|
||||
/** @type {Object} */
|
||||
this.audioFiles
|
||||
/** @type {Object} */
|
||||
/** @type {EBookFileObject} */
|
||||
this.ebookFile
|
||||
/** @type {Object} */
|
||||
/** @type {ChapterObject[]} */
|
||||
this.chapters
|
||||
/** @type {Object} */
|
||||
/** @type {string[]} */
|
||||
this.tags
|
||||
/** @type {Object} */
|
||||
/** @type {string[]} */
|
||||
this.genres
|
||||
/** @type {Date} */
|
||||
this.updatedAt
|
||||
|
@ -4,12 +4,20 @@ const oldLibraryItem = require('../objects/LibraryItem')
|
||||
const libraryFilters = require('../utils/queries/libraryFilters')
|
||||
const { areEquivalent } = require('../utils/index')
|
||||
|
||||
/**
|
||||
* @typedef LibraryFileObject
|
||||
* @property {string} ino
|
||||
* @property {boolean} isSupplementary
|
||||
* @property {number} addedAt
|
||||
* @property {number} updatedAt
|
||||
* @property {{filename:string, ext:string, path:string, relPath:string, size:number, mtimeMs:number, ctimeMs:number, birthtimeMs:number}} metadata
|
||||
*/
|
||||
|
||||
class LibraryItem extends Model {
|
||||
constructor(values, options) {
|
||||
super(values, options)
|
||||
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.id
|
||||
/** @type {string} */
|
||||
this.ino
|
||||
@ -17,7 +25,7 @@ class LibraryItem extends Model {
|
||||
this.path
|
||||
/** @type {string} */
|
||||
this.relPath
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.mediaId
|
||||
/** @type {string} */
|
||||
this.mediaType
|
||||
@ -39,13 +47,13 @@ class LibraryItem extends Model {
|
||||
this.lastScan
|
||||
/** @type {string} */
|
||||
this.lastScanVersion
|
||||
/** @type {Object} */
|
||||
/** @type {LibraryFileObject[]} */
|
||||
this.libraryFiles
|
||||
/** @type {Object} */
|
||||
this.extraData
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.libraryId
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.libraryFolderId
|
||||
/** @type {Date} */
|
||||
this.createdAt
|
||||
|
@ -4,7 +4,7 @@ class Podcast extends Model {
|
||||
constructor(values, options) {
|
||||
super(values, options)
|
||||
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.id
|
||||
/** @type {string} */
|
||||
this.title
|
||||
@ -42,9 +42,9 @@ class Podcast extends Model {
|
||||
this.maxEpisodesToKeep
|
||||
/** @type {string} */
|
||||
this.coverPath
|
||||
/** @type {Object} */
|
||||
/** @type {string[]} */
|
||||
this.tags
|
||||
/** @type {Object} */
|
||||
/** @type {string[]} */
|
||||
this.genres
|
||||
/** @type {Date} */
|
||||
this.createdAt
|
||||
|
@ -1,11 +1,19 @@
|
||||
const { DataTypes, Model } = require('sequelize')
|
||||
const oldPodcastEpisode = require('../objects/entities/PodcastEpisode')
|
||||
|
||||
/**
|
||||
* @typedef ChapterObject
|
||||
* @property {number} id
|
||||
* @property {number} start
|
||||
* @property {number} end
|
||||
* @property {string} title
|
||||
*/
|
||||
|
||||
class PodcastEpisode extends Model {
|
||||
constructor(values, options) {
|
||||
super(values, options)
|
||||
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.id
|
||||
/** @type {number} */
|
||||
this.index
|
||||
@ -33,11 +41,11 @@ class PodcastEpisode extends Model {
|
||||
this.publishedAt
|
||||
/** @type {Object} */
|
||||
this.audioFile
|
||||
/** @type {Object} */
|
||||
/** @type {ChapterObject[]} */
|
||||
this.chapters
|
||||
/** @type {Object} */
|
||||
this.extraData
|
||||
/** @type {UUIDV4} */
|
||||
/** @type {string} */
|
||||
this.podcastId
|
||||
/** @type {Date} */
|
||||
this.createdAt
|
||||
|
Loading…
Reference in New Issue
Block a user