Fix #628: Add setting to transcode stream

This commit is contained in:
Drew Weymouth
2025-05-31 10:12:57 -07:00
parent 0fd8b4621b
commit 265e4f961f
9 changed files with 74 additions and 15 deletions
@@ -332,12 +332,19 @@ func (j *jellyfinMediaProvider) SetFavorite(params mediaprovider.RatingFavoriteP
return err
}
func (j *jellyfinMediaProvider) GetStreamURL(trackID string, forceRaw bool) (string, error) {
return j.client.GetStreamURL(trackID)
func (j *jellyfinMediaProvider) GetStreamURL(trackID string, transcode *mediaprovider.TranscodeSettings, forceRaw bool) (string, error) {
var jfTranscode *jellyfin.TranscodeOptions
if transcode != nil {
jfTranscode = &jellyfin.TranscodeOptions{
AudioCodec: transcode.Codec,
AudioBitRate: uint32(transcode.BitRateKBPS * 1000),
}
}
return j.client.GetStreamURL(trackID, jfTranscode)
}
func (j *jellyfinMediaProvider) DownloadTrack(trackID string) (io.Reader, error) {
url, err := j.client.GetStreamURL(trackID)
url, err := j.client.GetStreamURL(trackID, nil)
if err != nil {
return nil, err
}