mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fixed a couple of issues, should be working well now
This commit is contained in:
parent
c1938f78c2
commit
d57effe97c
@ -57,7 +57,7 @@ class AudioMetadataMangaer {
|
|||||||
|
|
||||||
const results = []
|
const results = []
|
||||||
for (const af of audioFiles) {
|
for (const af of audioFiles) {
|
||||||
const result = await this.updateAudioFileMetadataWithTone(libraryItem.id, af, toneMetadataObject, itemCacheDir)
|
const result = await this.updateAudioFileMetadataWithTone(libraryItem.id, af, toneJsonPath, itemCacheDir)
|
||||||
results.push(result)
|
results.push(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,19 +126,20 @@ module.exports.writeToneMetadataJsonFile = (libraryItem, filePath) => {
|
|||||||
let metadataChapters = []
|
let metadataChapters = []
|
||||||
for (const chapter of chapters) {
|
for (const chapter of chapters) {
|
||||||
metadataChapters.push({
|
metadataChapters.push({
|
||||||
start: chapter.start,
|
start: Math.round(chapter.start * 1000),
|
||||||
length: chapter.end - chapter.start,
|
length: Math.round((chapter.end - chapter.start) * 1000),
|
||||||
title: chapter.title,
|
title: chapter.title,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
metadataObject['chapters'] = chaptersFile
|
metadataObject['chapters'] = metadataChapters
|
||||||
}
|
}
|
||||||
|
|
||||||
return fs.writeFile(filePath, JSON.stringify({ metadata: metadataObject }))
|
return fs.writeFile(filePath, JSON.stringify({ meta: metadataObject }))
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.tagAudioFile = (filePath, payload) => {
|
module.exports.tagAudioFile = (filePath, payload) => {
|
||||||
return tone.tag(filePath, payload).then((data) => {
|
return tone.tag(filePath, payload).then((data) => {
|
||||||
|
Logger.info('Tone results: ', data)
|
||||||
return true
|
return true
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
Logger.error(`[toneHelpers] tagAudioFile: Failed for "${filePath}"`, error)
|
Logger.error(`[toneHelpers] tagAudioFile: Failed for "${filePath}"`, error)
|
||||||
|
Loading…
Reference in New Issue
Block a user