API: Add playlist and start time to resolve_url

This adds `playlistId` and `startTimeSeconds` to /api/v1/resolveurl if these
informations were returned by Youtube's endpoint.
This commit is contained in:
Samantaz Fox 2024-02-12 22:01:08 +01:00
commit 9bd2072e1d
No known key found for this signature in database
GPG key ID: F42821059186176E

View file

@ -191,6 +191,8 @@ module Invidious::Routes::API::V1::Misc
json.object do
json.field "ucid", sub_endpoint["browseId"].as_s if sub_endpoint["browseId"]?
json.field "videoId", sub_endpoint["videoId"].as_s if sub_endpoint["videoId"]?
json.field "playlistId", sub_endpoint["playlistId"].as_s if sub_endpoint["playlistId"]?
json.field "startTimeSeconds", sub_endpoint["startTimeSeconds"].as_i if sub_endpoint["startTimeSeconds"]?
json.field "params", params.try &.as_s
json.field "pageType", pageType
end