mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-30 10:42:53 +00:00
Add logic to show/hide transcripts without JS
This commit is contained in:
@@ -38,6 +38,11 @@ module Invidious::Routes::Watch
|
||||
nojs ||= "0"
|
||||
nojs = nojs == "1"
|
||||
|
||||
show_transcripts = env.params.query["show_transcripts"]?
|
||||
|
||||
show_transcripts ||= "0"
|
||||
show_transcripts = show_transcripts == "1"
|
||||
|
||||
preferences = env.get("preferences").as(Preferences)
|
||||
|
||||
user = env.get?("user").try &.as(User)
|
||||
@@ -156,6 +161,13 @@ module Invidious::Routes::Watch
|
||||
}
|
||||
captions = captions - preferred_captions
|
||||
|
||||
if show_transcripts
|
||||
# Placeholder
|
||||
transcript = true
|
||||
else
|
||||
transcript = nil
|
||||
end
|
||||
|
||||
aspect_ratio = "16:9"
|
||||
|
||||
thumbnail = "/vi/#{video.id}/maxres.jpg"
|
||||
|
||||
Reference in New Issue
Block a user