mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 14:21:41 +00:00
Moved schemas into objects/ definitions
This commit is contained in:
parent
cc37c3d41f
commit
cc53f16185
30 changed files with 3380 additions and 3241 deletions
|
|
@ -1,3 +1,79 @@
|
|||
/**
|
||||
* @openapi
|
||||
* components:
|
||||
* schemas:
|
||||
* audioMetaTags:
|
||||
* description: ID3 metadata tags pulled from the audio file on import. Only non-null tags will be returned in requests.
|
||||
* type: object
|
||||
* properties:
|
||||
* tagAlbum:
|
||||
* type: [string, 'null']
|
||||
* example: SOT Bk01
|
||||
* tagArtist:
|
||||
* type: [string, 'null']
|
||||
* example: Terry Goodkind
|
||||
* tagGenre:
|
||||
* type: [string, 'null']
|
||||
* example: Audiobook Fantasy
|
||||
* tagTitle:
|
||||
* type: [string, 'null']
|
||||
* example: Wizards First Rule 01
|
||||
* tagSeries:
|
||||
* type: [string, 'null']
|
||||
* tagSeriesPart:
|
||||
* type: [string, 'null']
|
||||
* tagTrack:
|
||||
* type: [string, 'null']
|
||||
* example: 01/20
|
||||
* tagDisc:
|
||||
* type: [string, 'null']
|
||||
* tagSubtitle:
|
||||
* type: [string, 'null']
|
||||
* tagAlbumArtist:
|
||||
* type: [string, 'null']
|
||||
* example: Terry Goodkind
|
||||
* tagDate:
|
||||
* type: [string, 'null']
|
||||
* tagComposer:
|
||||
* type: [string, 'null']
|
||||
* example: Terry Goodkind
|
||||
* tagPublisher:
|
||||
* type: [string, 'null']
|
||||
* tagComment:
|
||||
* type: [string, 'null']
|
||||
* tagDescription:
|
||||
* type: [string, 'null']
|
||||
* tagEncoder:
|
||||
* type: [string, 'null']
|
||||
* tagEncodedBy:
|
||||
* type: [string, 'null']
|
||||
* tagIsbn:
|
||||
* type: [string, 'null']
|
||||
* tagLanguage:
|
||||
* type: [string, 'null']
|
||||
* tagASIN:
|
||||
* type: [string, 'null']
|
||||
* tagOverdriveMediaMarker:
|
||||
* type: [string, 'null']
|
||||
* tagOriginalYear:
|
||||
* type: [string, 'null']
|
||||
* tagReleaseCountry:
|
||||
* type: [string, 'null']
|
||||
* tagReleaseType:
|
||||
* type: [string, 'null']
|
||||
* tagReleaseStatus:
|
||||
* type: [string, 'null']
|
||||
* tagISRC:
|
||||
* type: [string, 'null']
|
||||
* tagMusicBrainzTrackId:
|
||||
* type: [string, 'null']
|
||||
* tagMusicBrainzAlbumId:
|
||||
* type: [string, 'null']
|
||||
* tagMusicBrainzAlbumArtistId:
|
||||
* type: [string, 'null']
|
||||
* tagMusicBrainzArtistId:
|
||||
* type: [string, 'null']
|
||||
*/
|
||||
class AudioMetaTags {
|
||||
constructor(metadata) {
|
||||
this.tagAlbum = null
|
||||
|
|
|
|||
|
|
@ -1,6 +1,287 @@
|
|||
const Logger = require('../../Logger')
|
||||
const { areEquivalent, copyValue, getTitleIgnorePrefix, getTitlePrefixAtEnd } = require('../../utils/index')
|
||||
const parseNameString = require('../../utils/parsers/parseNameString')
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* components:
|
||||
* schemas:
|
||||
* bookMetadata:
|
||||
* type: object
|
||||
* properties:
|
||||
* title:
|
||||
* description: The title of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Wizards First Rule
|
||||
* subtitle:
|
||||
* description: The subtitle of the book. Will be null if there is no subtitle.
|
||||
* type: [string, 'null']
|
||||
* authors:
|
||||
* description: The authors of the book.
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/authorMinified'
|
||||
* narrators:
|
||||
* description: The narrators of the audiobook.
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* example: Sam Tsoutsouvas
|
||||
* series:
|
||||
* description: The series the book belongs to.
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/seriesSequence'
|
||||
* genres:
|
||||
* description: The genres of the book.
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* example: Fantasy
|
||||
* publishedYear:
|
||||
* description: The year the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: '2008'
|
||||
* publishedDate:
|
||||
* description: The date the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* publisher:
|
||||
* description: The publisher of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Brilliance Audio
|
||||
* description:
|
||||
* description: A description for the book. Will be null if empty.
|
||||
* type: [string, 'null']
|
||||
* example: >-
|
||||
* The masterpiece that started Terry Goodkind's New York Times bestselling
|
||||
* epic Sword of Truth In the aftermath of the brutal murder of his father,
|
||||
* a mysterious woman, Kahlan Amnell, appears in Richard Cypher's forest
|
||||
* sanctuary seeking help...and more. His world, his very beliefs, are
|
||||
* shattered when ancient debts come due with thundering violence. In a
|
||||
* dark age it takes courage to live, and more than mere courage to
|
||||
* challenge those who hold dominion, Richard and Kahlan must take up that
|
||||
* challenge or become the next victims. Beyond awaits a bewitching land
|
||||
* where even the best of their hearts could betray them. Yet, Richard
|
||||
* fears nothing so much as what secrets his sword might reveal about his
|
||||
* own soul. Falling in love would destroy them - for reasons Richard can't
|
||||
* imagine and Kahlan dare not say. In their darkest hour, hunted
|
||||
* relentlessly, tormented by treachery and loss, Kahlan calls upon Richard
|
||||
* to reach beyond his sword - to invoke within himself something more
|
||||
* noble. Neither knows that the rules of battle have just changed...or
|
||||
* that their time has run out. Wizard's First Rule is the beginning. One
|
||||
* book. One Rule. Witness the birth of a legend.
|
||||
* isbn:
|
||||
* description: The ISBN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* asin:
|
||||
* description: The ASIN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: B002V0QK4C
|
||||
* language:
|
||||
* description: The language of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* explicit:
|
||||
* description: Whether the book has been marked as explicit.
|
||||
* type: boolean
|
||||
* example: false
|
||||
* bookMetadataMinified:
|
||||
* type: object
|
||||
* properties:
|
||||
* title:
|
||||
* description: The title of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Wizards First Rule
|
||||
* titleIgnorePrefix:
|
||||
* description: The title of the book with any prefix moved to the end.
|
||||
* type: string
|
||||
* subtitle:
|
||||
* description: The subtitle of the book. Will be null if there is no subtitle.
|
||||
* type: [string, 'null']
|
||||
* authorName:
|
||||
* description: The name of the book's author(s).
|
||||
* type: string
|
||||
* example: Terry Goodkind
|
||||
* authorNameLF:
|
||||
* description: The name of the book's author(s) with last names first.
|
||||
* type: string
|
||||
* example: Goodkind, Terry
|
||||
* narratorName:
|
||||
* description: The name of the audiobook's narrator(s).
|
||||
* type: string
|
||||
* example: Sam Tsoutsouvas
|
||||
* seriesName:
|
||||
* description: The name of the book's series.
|
||||
* type: string
|
||||
* example: Sword of Truth
|
||||
* genres:
|
||||
* description: The genres of the book.
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* example: Fantasy
|
||||
* publishedYear:
|
||||
* description: The year the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: '2008'
|
||||
* publishedDate:
|
||||
* description: The date the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* publisher:
|
||||
* description: The publisher of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Brilliance Audio
|
||||
* description:
|
||||
* description: A description for the book. Will be null if empty.
|
||||
* type: [string, 'null']
|
||||
* example: >-
|
||||
* The masterpiece that started Terry Goodkind's New York Times bestselling
|
||||
* epic Sword of Truth In the aftermath of the brutal murder of his father,
|
||||
* a mysterious woman, Kahlan Amnell, appears in Richard Cypher's forest
|
||||
* sanctuary seeking help...and more. His world, his very beliefs, are
|
||||
* shattered when ancient debts come due with thundering violence. In a
|
||||
* dark age it takes courage to live, and more than mere courage to
|
||||
* challenge those who hold dominion, Richard and Kahlan must take up that
|
||||
* challenge or become the next victims. Beyond awaits a bewitching land
|
||||
* where even the best of their hearts could betray them. Yet, Richard
|
||||
* fears nothing so much as what secrets his sword might reveal about his
|
||||
* own soul. Falling in love would destroy them - for reasons Richard can't
|
||||
* imagine and Kahlan dare not say. In their darkest hour, hunted
|
||||
* relentlessly, tormented by treachery and loss, Kahlan calls upon Richard
|
||||
* to reach beyond his sword - to invoke within himself something more
|
||||
* noble. Neither knows that the rules of battle have just changed...or
|
||||
* that their time has run out. Wizard's First Rule is the beginning. One
|
||||
* book. One Rule. Witness the birth of a legend.
|
||||
* isbn:
|
||||
* description: The ISBN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* asin:
|
||||
* description: The ASIN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: B002V0QK4C
|
||||
* language:
|
||||
* description: The language of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* explicit:
|
||||
* description: Whether the book has been marked as explicit.
|
||||
* type: boolean
|
||||
* example: false
|
||||
* bookMetadataExpanded:
|
||||
* type: object
|
||||
* properties:
|
||||
* title:
|
||||
* description: The title of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Wizards First Rule
|
||||
* titleIgnorePrefix:
|
||||
* description: The title of the book with any prefix moved to the end.
|
||||
* type: string
|
||||
* subtitle:
|
||||
* description: The subtitle of the book. Will be null if there is no subtitle.
|
||||
* type: [string, 'null']
|
||||
* authorName:
|
||||
* description: The name of the book's author(s).
|
||||
* type: string
|
||||
* example: Terry Goodkind
|
||||
* authorNameLF:
|
||||
* description: The name of the book's author(s) with last names first.
|
||||
* type: string
|
||||
* example: Goodkind, Terry
|
||||
* narratorName:
|
||||
* description: The name of the audiobook's narrator(s).
|
||||
* type: string
|
||||
* example: Sam Tsoutsouvas
|
||||
* seriesName:
|
||||
* description: The name of the book's series.
|
||||
* type: string
|
||||
* example: Sword of Truth
|
||||
* authors:
|
||||
* description: The authors of the book.
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/authorMinified'
|
||||
* narrators:
|
||||
* description: The narrators of the audiobook.
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* example: Sam Tsoutsouvas
|
||||
* series:
|
||||
* description: The series the book belongs to.
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/seriesSequence'
|
||||
* genres:
|
||||
* description: The genres of the book.
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* example: Fantasy
|
||||
* publishedYear:
|
||||
* description: The year the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: '2008'
|
||||
* publishedDate:
|
||||
* description: The date the book was published. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* publisher:
|
||||
* description: The publisher of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: Brilliance Audio
|
||||
* description:
|
||||
* description: A description for the book. Will be null if empty.
|
||||
* type: [string, 'null']
|
||||
* example: >-
|
||||
* The masterpiece that started Terry Goodkind's New York Times bestselling
|
||||
* epic Sword of Truth In the aftermath of the brutal murder of his father,
|
||||
* a mysterious woman, Kahlan Amnell, appears in Richard Cypher's forest
|
||||
* sanctuary seeking help...and more. His world, his very beliefs, are
|
||||
* shattered when ancient debts come due with thundering violence. In a
|
||||
* dark age it takes courage to live, and more than mere courage to
|
||||
* challenge those who hold dominion, Richard and Kahlan must take up that
|
||||
* challenge or become the next victims. Beyond awaits a bewitching land
|
||||
* where even the best of their hearts could betray them. Yet, Richard
|
||||
* fears nothing so much as what secrets his sword might reveal about his
|
||||
* own soul. Falling in love would destroy them - for reasons Richard can't
|
||||
* imagine and Kahlan dare not say. In their darkest hour, hunted
|
||||
* relentlessly, tormented by treachery and loss, Kahlan calls upon Richard
|
||||
* to reach beyond his sword - to invoke within himself something more
|
||||
* noble. Neither knows that the rules of battle have just changed...or
|
||||
* that their time has run out. Wizard's First Rule is the beginning. One
|
||||
* book. One Rule. Witness the birth of a legend.
|
||||
* isbn:
|
||||
* description: The ISBN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* asin:
|
||||
* description: The ASIN of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* example: B002V0QK4C
|
||||
* language:
|
||||
* description: The language of the book. Will be null if unknown.
|
||||
* type: [string, 'null']
|
||||
* explicit:
|
||||
* description: Whether the book has been marked as explicit.
|
||||
* type: boolean
|
||||
* example: false
|
||||
* bookChapter:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* description: The ID of the book chapter.
|
||||
* type: integer
|
||||
* example: 0
|
||||
* start:
|
||||
* description: When in the book (in seconds) the chapter starts.
|
||||
* type: integer
|
||||
* example: 0
|
||||
* end:
|
||||
* description: When in the book (in seconds) the chapter ends.
|
||||
* type: number
|
||||
* example: 6004.6675
|
||||
* title:
|
||||
* description: The title of the chapter.
|
||||
* type: string
|
||||
* example: Wizards First Rule 01
|
||||
*/
|
||||
class BookMetadata {
|
||||
constructor(metadata) {
|
||||
this.title = null
|
||||
|
|
|
|||
|
|
@ -1,3 +1,45 @@
|
|||
/**
|
||||
* @openapi
|
||||
* components:
|
||||
* schemas:
|
||||
* fileMetadata:
|
||||
* type: [object, 'null']
|
||||
* properties:
|
||||
* filename:
|
||||
* description: The filename of the file.
|
||||
* type: string
|
||||
* example: Wizards First Rule 01.mp3
|
||||
* ext:
|
||||
* description: The file extension of the file.
|
||||
* type: string
|
||||
* example: .mp3
|
||||
* path:
|
||||
* description: The absolute path on the server of the file.
|
||||
* type: string
|
||||
* example: >-
|
||||
* /audiobooks/Terry Goodkind/Sword of Truth/Wizards First Rule/Terry
|
||||
* Goodkind - SOT Bk01 - Wizards First Rule 01.mp3
|
||||
* relPath:
|
||||
* description: The path of the file, relative to the book's or podcast's folder.
|
||||
* type: string
|
||||
* example: Wizards First Rule 01.mp3
|
||||
* size:
|
||||
* description: The size (in bytes) of the file.
|
||||
* type: integer
|
||||
* example: 48037888
|
||||
* mtimeMs:
|
||||
* description: The time (in ms since POSIX epoch) when the file was last modified on disk.
|
||||
* type: integer
|
||||
* example: 1632223180278
|
||||
* ctimeMs:
|
||||
* description: The time (in ms since POSIX epoch) when the file status was changed on disk.
|
||||
* type: integer
|
||||
* example: 1645978261001
|
||||
* birthtimeMs:
|
||||
* description: The time (in ms since POSIX epoch) when the file was created on disk. Will be 0 if unknown.
|
||||
* type: integer
|
||||
* example: 0
|
||||
*/
|
||||
class FileMetadata {
|
||||
constructor(metadata) {
|
||||
this.filename = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue