mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-09 04:29:36 +00:00
Change:Server setting for coverDestination to storeCoverWithBook boolean, Add:abmetadata generator
This commit is contained in:
parent
4e7d2ddc58
commit
eb109c398f
9 changed files with 33 additions and 51 deletions
|
|
@ -20,13 +20,24 @@ const bookKeyMap = {
|
|||
}
|
||||
|
||||
function generate(audiobook, outputPath, uid, gid) {
|
||||
var fileString = `[audiobookshelf v${package.version}]\n`
|
||||
var fileString = ';ABMETADATA1\n'
|
||||
fileString += `#audiobookshelf v${package.version}\n\n`
|
||||
|
||||
for (const key in bookKeyMap) {
|
||||
const value = audiobook.book[bookKeyMap[key]] || ''
|
||||
fileString += `${key}=${value}\n`
|
||||
}
|
||||
|
||||
if (audiobook.chapters.length) {
|
||||
fileString += '\n'
|
||||
audiobook.chapters.forEach((chapter) => {
|
||||
fileString += `[CHAPTER]\n`
|
||||
fileString += `start=${chapter.start}\n`
|
||||
fileString += `end=${chapter.end}\n`
|
||||
fileString += `title=${chapter.title}\n`
|
||||
})
|
||||
}
|
||||
|
||||
return fs.writeFile(outputPath, fileString).then(() => {
|
||||
return filePerms(outputPath, 0o774, uid, gid).then(() => true)
|
||||
}).catch((error) => {
|
||||
|
|
@ -6,11 +6,6 @@ module.exports.ScanResult = {
|
|||
UPTODATE: 4
|
||||
}
|
||||
|
||||
module.exports.CoverDestination = {
|
||||
METADATA: 0,
|
||||
AUDIOBOOK: 1
|
||||
}
|
||||
|
||||
module.exports.BookCoverAspectRatio = {
|
||||
STANDARD: 0, // 1.6:1
|
||||
SQUARE: 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue