mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-19 10:19:37 +00:00
Update:Remove support for metadata.abs, added script to create metadata.json files if they dont exist
This commit is contained in:
parent
ce88c6ccc3
commit
60a80a2996
30 changed files with 390 additions and 945 deletions
|
|
@ -211,6 +211,32 @@ class Book extends Model {
|
|||
}
|
||||
}
|
||||
|
||||
getAbsMetadataJson() {
|
||||
return {
|
||||
tags: this.tags || [],
|
||||
chapters: this.chapters?.map(c => ({ ...c })) || [],
|
||||
title: this.title,
|
||||
subtitle: this.subtitle,
|
||||
authors: this.authors.map(a => a.name),
|
||||
narrators: this.narrators,
|
||||
series: this.series.map(se => {
|
||||
const sequence = se.bookSeries?.sequence || ''
|
||||
if (!sequence) return se.name
|
||||
return `${se.name} #${sequence}`
|
||||
}),
|
||||
genres: this.genres || [],
|
||||
publishedYear: this.publishedYear,
|
||||
publishedDate: this.publishedDate,
|
||||
publisher: this.publisher,
|
||||
description: this.description,
|
||||
isbn: this.isbn,
|
||||
asin: this.asin,
|
||||
language: this.language,
|
||||
explicit: !!this.explicit,
|
||||
abridged: !!this.abridged
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize model
|
||||
* @param {import('../Database').sequelize} sequelize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue