unify setCertificates functionality (#1282)

Co-authored-by: Charles Ewert <cewert@gmail.com>
This commit is contained in:
Austin Crandall 2023-06-01 14:09:38 -04:00 committed by GitHub
parent bdfcac74e6
commit d5b7e0ebdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -180,7 +180,7 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
video.isTranscoded = true video.isTranscoded = true
end if end if
video.content.setCertificatesFile("common:/certs/ca-bundle.crt") setCertificateAuthority(video.content)
video.audioTrack = (audio_stream_idx + 1).ToStr() ' Roku's track indexes count from 1. Our index is zero based video.audioTrack = (audio_stream_idx + 1).ToStr() ' Roku's track indexes count from 1. Our index is zero based
video.SelectedSubtitle = subtitle_idx video.SelectedSubtitle = subtitle_idx

View File

@ -304,7 +304,7 @@ sub AddVideoContent(video as object, mediaSourceId as dynamic, audio_stream_idx
video.isTranscoded = true video.isTranscoded = true
end if end if
video.content.setCertificatesFile("common:/certs/ca-bundle.crt") setCertificateAuthority(video.content)
video.audioTrack = (audio_stream_idx + 1).ToStr() ' Roku's track indexes count from 1. Our index is zero based video.audioTrack = (audio_stream_idx + 1).ToStr() ' Roku's track indexes count from 1. Our index is zero based
' Perform relevant setup work for selected subtitle, and return the index of the subtitle ' Perform relevant setup work for selected subtitle, and return the index of the subtitle

View File

@ -65,7 +65,7 @@ function APIRequest(url as string, params = {} as object) as dynamic
req = authorize_request(req) req = authorize_request(req)
' SSL cert ' SSL cert
if serverURL.left(8) = "https://" if serverURL.left(8) = "https://"
req.setCertificatesFile("common:/certs/ca-bundle.crt") setCertificateAuthority(req)
end if end if
return req return req
@ -189,6 +189,11 @@ function postString(req, data = "" as string)
return resp.getString() return resp.getString()
end function end function
' sets the certificate authority by file path on the passed node
sub setCertificateAuthority(request as object) as void
request.setCertificatesFile("common:/certs/ca-bundle.crt")
end sub
function authorize_request(request) function authorize_request(request)
auth = "MediaBrowser" + " Client=" + Chr(34) + "Jellyfin Roku" + Chr(34) auth = "MediaBrowser" + " Client=" + Chr(34) + "Jellyfin Roku" + Chr(34)
auth = auth + ", Device=" + Chr(34) + m.global.device.name + " (" + m.global.device.friendlyName + ")" + Chr(34) auth = auth + ", Device=" + Chr(34) + m.global.device.name + " (" + m.global.device.friendlyName + ")" + Chr(34)