diff --git a/server/models/Book.js b/server/models/Book.js index 96371f3a2..8707e1135 100644 --- a/server/models/Book.js +++ b/server/models/Book.js @@ -61,6 +61,8 @@ const libraryItemsBookFilters = require('../utils/queries/libraryItemsBookFilter * @property {string} timeBase * @property {number} channels * @property {string} channelLayout + * @property {number} sampleRate + * @property {string} profile * @property {ChapterObject[]} chapters * @property {Object} metaTags * @property {string} mimeType diff --git a/server/objects/files/AudioFile.js b/server/objects/files/AudioFile.js index c0c425ba3..ef05e197c 100644 --- a/server/objects/files/AudioFile.js +++ b/server/objects/files/AudioFile.js @@ -24,6 +24,8 @@ class AudioFile { this.timeBase = null this.channels = null this.channelLayout = null + this.sampleRate = null + this.profile = null this.chapters = [] this.embeddedCoverArt = null @@ -62,6 +64,8 @@ class AudioFile { timeBase: this.timeBase, channels: this.channels, channelLayout: this.channelLayout, + sampleRate: this.sampleRate, + profile: this.profile, chapters: this.chapters, embeddedCoverArt: this.embeddedCoverArt, metaTags: this.metaTags?.toJSON() || {}, @@ -94,6 +98,8 @@ class AudioFile { this.timeBase = data.timeBase this.channels = data.channels this.channelLayout = data.channelLayout + this.sampleRate = data.sampleRate + this.profile = data.profile this.chapters = data.chapters this.embeddedCoverArt = data.embeddedCoverArt || null @@ -130,6 +136,8 @@ class AudioFile { this.timeBase = probeData.timeBase this.channels = probeData.channels this.channelLayout = probeData.channelLayout + this.sampleRate = probeData.sampleRate + this.profile = probeData.profile this.chapters = probeData.chapters || [] this.metaTags = probeData.audioMetaTags this.embeddedCoverArt = probeData.embeddedCoverArt @@ -137,7 +145,7 @@ class AudioFile { syncChapters(updatedChapters) { if (this.chapters.length !== updatedChapters.length) { - this.chapters = updatedChapters.map(ch => ({ ...ch })) + this.chapters = updatedChapters.map((ch) => ({ ...ch })) return true } else if (updatedChapters.length === 0) { if (this.chapters.length > 0) { @@ -154,7 +162,7 @@ class AudioFile { } } if (hasUpdates) { - this.chapters = updatedChapters.map(ch => ({ ...ch })) + this.chapters = updatedChapters.map((ch) => ({ ...ch })) } return hasUpdates } @@ -164,8 +172,8 @@ class AudioFile { } /** - * - * @param {AudioFile} scannedAudioFile + * + * @param {AudioFile} scannedAudioFile * @returns {boolean} true if updates were made */ updateFromScan(scannedAudioFile) { @@ -196,4 +204,4 @@ class AudioFile { return hasUpdated } } -module.exports = AudioFile \ No newline at end of file +module.exports = AudioFile diff --git a/server/scanner/MediaProbeData.js b/server/scanner/MediaProbeData.js index 19480968e..cbe3f8025 100644 --- a/server/scanner/MediaProbeData.js +++ b/server/scanner/MediaProbeData.js @@ -17,6 +17,7 @@ class MediaProbeData { this.channelLayout = null this.channels = null this.sampleRate = null + this.profile = null this.chapters = [] this.audioMetaTags = null @@ -58,6 +59,7 @@ class MediaProbeData { this.channelLayout = this.audioStream.channel_layout this.channels = this.audioStream.channels this.sampleRate = this.audioStream.sample_rate + this.profile = this.audioStream.profile this.chapters = data.chapters || [] this.audioMetaTags = new AudioMetaTags() diff --git a/server/utils/prober.js b/server/utils/prober.js index 40a3b5b5c..0f64dacf7 100644 --- a/server/utils/prober.js +++ b/server/utils/prober.js @@ -114,6 +114,7 @@ function parseMediaStreamInfo(stream, all_streams, total_bit_rate) { info.channels = stream.channels || null info.sample_rate = tryGrabSampleRate(stream) info.channel_layout = tryGrabChannelLayout(stream) + info.profile = stream.profile || null } return info