mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-09 15:02:14 +05:30
Fetch chapter thumbnails for selector in desc
This commit is contained in:
parent
48ba6373df
commit
ddd931573a
@ -160,6 +160,16 @@ module Invidious::Routes::Images
|
||||
id = env.params.url["id"]
|
||||
name = env.params.url["name"]
|
||||
|
||||
# Sometimes required to fetch image. IE for chapter thumbnails
|
||||
query_params = HTTP::Params.new
|
||||
if sqp = env.params.query["sqp"]?
|
||||
query_params["sqp"] = sqp
|
||||
end
|
||||
|
||||
if rs = env.params.query["rs"]?
|
||||
query_params["rs"] = rs
|
||||
end
|
||||
|
||||
headers = HTTP::Headers.new
|
||||
|
||||
if name == "maxres.jpg"
|
||||
@ -173,7 +183,7 @@ module Invidious::Routes::Images
|
||||
end
|
||||
end
|
||||
|
||||
url = "/vi/#{id}/#{name}"
|
||||
url = "/vi/#{id}/#{name}?#{query_params}"
|
||||
|
||||
REQUEST_HEADERS_WHITELIST.each do |header|
|
||||
if env.request.headers[header]?
|
||||
|
@ -10,7 +10,7 @@
|
||||
<a href="/watch?v=<%= video.id %>&t=<%=chapter.start_ms.milliseconds.total_seconds %>">
|
||||
<div class="thumbnail">
|
||||
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||
<img loading="lazy" class="thumbnail" src="/vi/" alt="" />
|
||||
<img loading="lazy" class="thumbnail" src="<%=URI.parse(chapter.thumbnails[-1]["url"].to_s).request_target %>" alt="" />
|
||||
<%- else -%>
|
||||
<div class="thumbnail-placeholder"></div>
|
||||
<%- end -%>
|
||||
|
Loading…
Reference in New Issue
Block a user