Fix #668: Add sample rate, bit depth, channels to track info dialog
This commit is contained in:
@@ -449,6 +449,16 @@ func toTrack(ch *jellyfin.Song) *mediaprovider.Track {
|
||||
t.FilePath = ch.MediaSources[0].Path
|
||||
t.Size = int64(ch.MediaSources[0].Size)
|
||||
t.BitRate = ch.MediaSources[0].Bitrate / 1000
|
||||
if strs := ch.MediaSources[0].MediaStreams; len(strs) > 0 {
|
||||
t.SampleRate = strs[0].SampleRate
|
||||
t.BitDepth = strs[0].BitDepth
|
||||
t.Channels = strs[0].Channels
|
||||
}
|
||||
}
|
||||
if len(ch.MediaStreams) > 0 {
|
||||
t.SampleRate = max(t.SampleRate, ch.MediaStreams[0].SampleRate)
|
||||
t.BitDepth = max(t.BitDepth, ch.MediaStreams[0].BitDepth)
|
||||
t.Channels = max(t.Channels, ch.MediaStreams[0].Channels)
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
@@ -149,6 +149,9 @@ type Track struct {
|
||||
Comment string
|
||||
BPM int
|
||||
ReplayGain ReplayGainInfo
|
||||
SampleRate int
|
||||
BitDepth int
|
||||
Channels int
|
||||
}
|
||||
|
||||
type ReplayGainInfo struct {
|
||||
|
||||
@@ -573,6 +573,9 @@ func toTrack(ch *subsonic.Child) *mediaprovider.Track {
|
||||
Comment: ch.Comment,
|
||||
BPM: ch.BPM,
|
||||
ReplayGain: rGain,
|
||||
SampleRate: ch.SamplingRate,
|
||||
BitDepth: ch.BitDepth,
|
||||
Channels: ch.ChannelCount,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user