mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Change:Fallback to audio stream tags if probe format has no tags and remove old scanner #256
This commit is contained in:
parent
3f8551f9a1
commit
a17348f916
12 changed files with 97 additions and 1269 deletions
|
@ -21,20 +21,13 @@ class AudioProbeData {
|
|||
this.trackTotal = null
|
||||
}
|
||||
|
||||
getDefaultAudioStream(audioStreams) {
|
||||
if (audioStreams.length === 1) return audioStreams[0]
|
||||
var defaultStream = audioStreams.find(a => a.is_default)
|
||||
if (!defaultStream) return audioStreams[0]
|
||||
return defaultStream
|
||||
}
|
||||
|
||||
getEmbeddedCoverArt(videoStream) {
|
||||
const ImageCodecs = ['mjpeg', 'jpeg', 'png']
|
||||
return ImageCodecs.includes(videoStream.codec) ? videoStream.codec : null
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
var audioStream = this.getDefaultAudioStream(data.audio_streams)
|
||||
var audioStream = data.audio_stream
|
||||
this.embeddedCoverArt = data.video_stream ? this.getEmbeddedCoverArt(data.video_stream) : null
|
||||
this.format = data.format
|
||||
this.duration = data.duration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue