mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Removed a noisy log and limit chapter embedding to items with only 1 audiofile
This commit is contained in:
parent
d57effe97c
commit
586c8a550a
@ -49,7 +49,7 @@ class AudioMetadataMangaer {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
toneJsonPath = Path.join(itemCacheDir, 'metadata.json')
|
toneJsonPath = Path.join(itemCacheDir, 'metadata.json')
|
||||||
await toneHelpers.writeToneMetadataJsonFile(libraryItem, toneJsonPath)
|
await toneHelpers.writeToneMetadataJsonFile(libraryItem, audioFiles.length == 1 && libraryItem.media.chapters, toneJsonPath)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(`[AudioMetadataManager] Write metadata.json failed`, error)
|
Logger.error(`[AudioMetadataManager] Write metadata.json failed`, error)
|
||||||
toneJsonPath = null
|
toneJsonPath = null
|
||||||
|
@ -72,10 +72,9 @@ module.exports.getToneMetadataObject = (libraryItem, chaptersFile) => {
|
|||||||
return metadataObject
|
return metadataObject
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.writeToneMetadataJsonFile = (libraryItem, filePath) => {
|
module.exports.writeToneMetadataJsonFile = (libraryItem, chapters, filePath) => {
|
||||||
const bookMetadata = libraryItem.media.metadata
|
const bookMetadata = libraryItem.media.metadata
|
||||||
const coverPath = libraryItem.media.coverPath
|
const coverPath = libraryItem.media.coverPath
|
||||||
const chapters = libraryItem.media.chapters
|
|
||||||
|
|
||||||
const metadataObject = {
|
const metadataObject = {
|
||||||
'album': bookMetadata.title || '',
|
'album': bookMetadata.title || '',
|
||||||
@ -139,7 +138,6 @@ module.exports.writeToneMetadataJsonFile = (libraryItem, filePath) => {
|
|||||||
|
|
||||||
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