From 3b01bc673546384d4540e15e4633b09b94b9b936 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 4 Aug 2018 20:27:53 -0500 Subject: [PATCH] Add support for 'listen=1' --- src/invidious.cr | 4 ++-- src/invidious/views/watch.ecr | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 9d567fc0..0eb334ab 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -221,7 +221,7 @@ get "/watch" do |env| end video_end ||= -1 - if env.params.query["listen"]? && env.params.query["listen"] == "true" + if env.params.query["listen"]? && env.params.query["listen"] == "true" || env.params.query["listen"] == "1" listen = true env.params.query.delete_all("listen") end @@ -381,7 +381,7 @@ get "/embed/:id" do |env| end video_end ||= -1 - if env.params.query["listen"]? && env.params.query["listen"] == "true" + if env.params.query["listen"]? && env.params.query["listen"] == "true" || env.params.query["listen"] == "1" listen = true env.params.query.delete_all("listen") end diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index bbfebc4a..85ceafb6 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -49,14 +49,14 @@ <% else %> <% if listen %> <% audio_streams.each_with_index do |fmt, i| %> - " type="<%= fmt["type"] %>" label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>"> + " type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>"> <% end %> <% else %> <% fmt_stream.each_with_index do |fmt, i| %> <% if preferences %> - " type="<%= fmt["type"] %>" label="<%= fmt["label"] %>" selected="<%= preferences.quality == fmt["label"].split(" - ")[0] %>"> + " type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= preferences.quality == fmt["label"].split(" - ")[0] %>"> <% else %> - " type="<%= fmt["type"] %>" label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>"> + " type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>"> <% end %> <% end %> @@ -327,7 +327,7 @@ get_youtube_comments(); <% else %> - + <% end %>