mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Change 'videoThumbnails' to an array everywhere
This commit is contained in:
parent
f9b45dd7b8
commit
ca2320f17f
@ -1971,6 +1971,7 @@ get "/api/v1/videos/:id" do |env|
|
|||||||
]
|
]
|
||||||
json.array do
|
json.array do
|
||||||
qualities.each do |quality|
|
qualities.each do |quality|
|
||||||
|
json.object do
|
||||||
json.field "quality", quality[:name]
|
json.field "quality", quality[:name]
|
||||||
json.field "url", "https://i.ytimg.com/vi/#{rv["id"]}/#{quality["url"]}.jpg"
|
json.field "url", "https://i.ytimg.com/vi/#{rv["id"]}/#{quality["url"]}.jpg"
|
||||||
json.field "width", quality[:width]
|
json.field "width", quality[:width]
|
||||||
@ -1978,6 +1979,7 @@ get "/api/v1/videos/:id" do |env|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
json.field "author", rv["author"]
|
json.field "author", rv["author"]
|
||||||
json.field "lengthSeconds", rv["length_seconds"].to_i
|
json.field "lengthSeconds", rv["length_seconds"].to_i
|
||||||
json.field "viewCountText", rv["short_view_count_text"].rchop(" views")
|
json.field "viewCountText", rv["short_view_count_text"].rchop(" views")
|
||||||
@ -2403,14 +2405,14 @@ get "/api/v1/search" do |env|
|
|||||||
json.field "authorUrl", "/channel/#{video.ucid}"
|
json.field "authorUrl", "/channel/#{video.ucid}"
|
||||||
|
|
||||||
json.field "videoThumbnails" do
|
json.field "videoThumbnails" do
|
||||||
json.object do
|
|
||||||
qualities = [{name: "default", url: "default", width: 120, height: 90},
|
qualities = [{name: "default", url: "default", width: 120, height: 90},
|
||||||
{name: "high", url: "hqdefault", width: 480, height: 360},
|
{name: "high", url: "hqdefault", width: 480, height: 360},
|
||||||
{name: "medium", url: "mqdefault", width: 320, height: 180},
|
{name: "medium", url: "mqdefault", width: 320, height: 180},
|
||||||
]
|
]
|
||||||
|
json.array do
|
||||||
qualities.each do |quality|
|
qualities.each do |quality|
|
||||||
json.field quality[:name] do
|
|
||||||
json.object do
|
json.object do
|
||||||
|
json.field "quality", quality[:name]
|
||||||
json.field "url", "https://i.ytimg.com/vi/#{video.id}/#{quality["url"]}.jpg"
|
json.field "url", "https://i.ytimg.com/vi/#{video.id}/#{quality["url"]}.jpg"
|
||||||
json.field "width", quality[:width]
|
json.field "width", quality[:width]
|
||||||
json.field "height", quality[:height]
|
json.field "height", quality[:height]
|
||||||
@ -2418,7 +2420,6 @@ get "/api/v1/search" do |env|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
json.field "description", video.description
|
json.field "description", video.description
|
||||||
json.field "descriptionHtml", video.description_html
|
json.field "descriptionHtml", video.description_html
|
||||||
|
Loading…
Reference in New Issue
Block a user