Update:Remove support for metadata.abs, added script to create metadata.json files if they dont exist

This commit is contained in:
advplyr 2023-10-22 15:53:05 -05:00
parent ce88c6ccc3
commit 60a80a2996
30 changed files with 390 additions and 945 deletions

View file

@ -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