mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-04 01:09:40 +00:00
Add db migration file to change audiobooks to library items with new data model
This commit is contained in:
parent
65793f7109
commit
b97ed953f7
17 changed files with 719 additions and 127 deletions
|
|
@ -1,4 +1,4 @@
|
|||
class AudioFileMetadata {
|
||||
class AudioMetaTags {
|
||||
constructor(metadata) {
|
||||
this.tagAlbum = null
|
||||
this.tagArtist = null
|
||||
|
|
@ -126,4 +126,4 @@ class AudioFileMetadata {
|
|||
return true
|
||||
}
|
||||
}
|
||||
module.exports = AudioFileMetadata
|
||||
module.exports = AudioMetaTags
|
||||
|
|
@ -22,12 +22,12 @@ class BookMetadata {
|
|||
construct(metadata) {
|
||||
this.title = metadata.title
|
||||
this.subtitle = metadata.subtitle
|
||||
this.authors = metadata.authors.map(a => ({ ...a }))
|
||||
this.narrators = [...metadata.narrators]
|
||||
this.series = metadata.series.map(s => ({ ...s }))
|
||||
this.genres = [...metadata.genres]
|
||||
this.publishedYear = metadata.publishedYear
|
||||
this.publishedDate = metadata.publishedDate
|
||||
this.authors = (metadata.authors && metadata.authors.map) ? metadata.authors.map(a => ({ ...a })) : []
|
||||
this.narrators = metadata.narrators ? [...metadata.narrators] : []
|
||||
this.series = (metadata.series && metadata.series.map) ? metadata.series.map(s => ({ ...s })) : []
|
||||
this.genres = metadata.genres ? [...metadata.genres] : []
|
||||
this.publishedYear = metadata.publishedYear || null
|
||||
this.publishedDate = metadata.publishedDate || null
|
||||
this.publisher = metadata.publisher
|
||||
this.description = metadata.description
|
||||
this.isbn = metadata.isbn
|
||||
|
|
|
|||
|
|
@ -37,5 +37,9 @@ class FileMetadata {
|
|||
birthtimeMs: this.birthtimeMs
|
||||
}
|
||||
}
|
||||
|
||||
clone() {
|
||||
return new FileMetadata(this.toJSON())
|
||||
}
|
||||
}
|
||||
module.exports = FileMetadata
|
||||
Loading…
Add table
Add a link
Reference in a new issue