From 586c8a550a9b53487aabd13fa47d44626cf1da09 Mon Sep 17 00:00:00 2001 From: Keagan Hilliard Date: Thu, 3 Nov 2022 10:09:49 -0600 Subject: [PATCH] Removed a noisy log and limit chapter embedding to items with only 1 audiofile --- server/managers/AudioMetadataManager.js | 2 +- server/utils/toneHelpers.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/managers/AudioMetadataManager.js b/server/managers/AudioMetadataManager.js index 88bb83e9..c76e3fe2 100644 --- a/server/managers/AudioMetadataManager.js +++ b/server/managers/AudioMetadataManager.js @@ -49,7 +49,7 @@ class AudioMetadataMangaer { try { toneJsonPath = Path.join(itemCacheDir, 'metadata.json') - await toneHelpers.writeToneMetadataJsonFile(libraryItem, toneJsonPath) + await toneHelpers.writeToneMetadataJsonFile(libraryItem, audioFiles.length == 1 && libraryItem.media.chapters, toneJsonPath) } catch (error) { Logger.error(`[AudioMetadataManager] Write metadata.json failed`, error) toneJsonPath = null diff --git a/server/utils/toneHelpers.js b/server/utils/toneHelpers.js index ff57bf1e..fcdd1440 100644 --- a/server/utils/toneHelpers.js +++ b/server/utils/toneHelpers.js @@ -72,10 +72,9 @@ module.exports.getToneMetadataObject = (libraryItem, chaptersFile) => { return metadataObject } -module.exports.writeToneMetadataJsonFile = (libraryItem, filePath) => { +module.exports.writeToneMetadataJsonFile = (libraryItem, chapters, filePath) => { const bookMetadata = libraryItem.media.metadata const coverPath = libraryItem.media.coverPath - const chapters = libraryItem.media.chapters const metadataObject = { 'album': bookMetadata.title || '', @@ -139,7 +138,6 @@ module.exports.writeToneMetadataJsonFile = (libraryItem, filePath) => { module.exports.tagAudioFile = (filePath, payload) => { return tone.tag(filePath, payload).then((data) => { - Logger.info('Tone results: ', data) return true }).catch((error) => { Logger.error(`[toneHelpers] tagAudioFile: Failed for "${filePath}"`, error)