Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent type mismatch crash #1938

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/api/sdk.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ namespace api

' Moves a playlist item.
function Move(playlistid as string, itemid as string, newindex as integer)
req = APIRequest(Substitute("/playlists/{0}/items/{1}/move/{2}", playlistid, itemid, newindex))
req = APIRequest(Substitute("/playlists/{0}/items/{1}/move/{2}", playlistid, itemid, newindex.ToStr()))
return postVoid(req)
end function
end namespace
Expand Down Expand Up @@ -2099,7 +2099,7 @@ namespace api

' Gets an HLS subtitle playlist.
function GetHLSSubtitlePlaylistURL(id as string, streamindex as integer, mediasourceid as string, params = {} as object)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not overly familiar with the purpose of this file, but these three functions that I'm fixing are not called anywhere in the roku codebase. Should they be deleted instead of fixed?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original sdk file had all the API calls and it was eventually trimmed down to only those we use. I'm fine with removing them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original purpose of the file was to have a matching function for every API call that Jellyfin uses (https://api.jellyfin.org/). It was originally created as a roku module then later converted after we switched to brighterscript.

I don't believe we ever trimmed down the functions which is why we have errors for functions we don't use. I'm open to removing any or all of the functions we don't use

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll clean these up later #1967

return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/subtitles.m3u8", id, streamindex, mediasourceid), params)
return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/subtitles.m3u8", id, streamindex.ToStr(), mediasourceid), params)
end function

' Upload an external subtitle file.
Expand All @@ -2115,13 +2115,13 @@ namespace api
' Gets subtitles in a specified format.
function GetSubtitlesWithStartPosition(routeitemid as string, routemediasourceid as string, routeindex as integer, routestartpositionticks as integer, routeformat as string, params = {} as object)
' We maxed out params for substitute() so we must manually add the routeformat value
return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/{3}/stream." + routeformat, routeitemid, routemediasourceid, routeindex, routestartpositionticks), params)
return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/{3}/stream." + routeformat, routeitemid, routemediasourceid, routeindex.ToStr(), routestartpositionticks.ToStr()), params)
end function

' Gets subtitles in a specified format.
function GetSubtitles(routeitemid as string, routemediasourceid as string, routeindex as integer, routestartpositionticks as integer, routeformat as string, params = {} as object)
' We maxed out params for substitute() so we must manually add the routeformat value
return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/{3}/stream." + routeformat, routeitemid, routemediasourceid, routeindex, routestartpositionticks), params)
return buildURL(Substitute("/videos/{0}/{1}/subtitles/{2}/{3}/stream." + routeformat, routeitemid, routemediasourceid, routeindex.ToStr(), routestartpositionticks.ToStr()), params)
end function
end namespace

Expand Down
Loading