From 2b94975345a3bdd085a99081de521d1c5d3ada48 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 16 Aug 2019 20:06:21 -0500 Subject: [PATCH] Fix playlist_thumbnail extractor --- assets/css/default.css | 11 +++++++---- src/invidious.cr | 5 ++--- src/invidious/helpers/helpers.cr | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index 451fbc8c..4daa9f16 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1,6 +1,8 @@ html, body { - font-family: BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif; + font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, + Arial, sans-serif; } .deleted { @@ -108,6 +110,7 @@ img.thumbnail { height: 100%; left: 0; top: 0; + object-fit: cover; } .length { @@ -442,8 +445,8 @@ video.video-js { } .video-js.player-style-youtube .vjs-control-bar { - display: flex; - flex-direction: row; + display: flex; + flex-direction: row; } .video-js.player-style-youtube .vjs-big-play-button { /* @@ -452,6 +455,6 @@ video.video-js { */ top: 50%; left: 50%; - margin-top: -.81666em; + margin-top: -0.81666em; margin-left: -1.5em; } diff --git a/src/invidious.cr b/src/invidious.cr index 21d6544d..2fa1d66f 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3003,7 +3003,7 @@ get "/user/:user/about" do |env| env.redirect "/channel/#{user}" end -get "/channel:ucid/about" do |env| +get "/channel/:ucid/about" do |env| ucid = env.params.url["ucid"] env.redirect "/channel/#{ucid}" end @@ -3107,8 +3107,7 @@ get "/channel/:ucid/playlists" do |env| end items, continuation = fetch_channel_playlists(channel.ucid, channel.author, channel.auto_generated, continuation, sort_by) - items.select! { |item| item.is_a?(SearchPlaylist) && !item.videos.empty? } - items = items.map { |item| item.as(SearchPlaylist) } + items = items.select { |item| item.is_a?(SearchPlaylist) }.map { |item| item.as(SearchPlaylist) } items.each { |item| item.author = "" } env.set "search", "channel:#{channel.ucid} " diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index e018e567..1b232072 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -397,8 +397,8 @@ def extract_items(nodeset, ucid = nil, author_name = nil) ) end - playlist_thumbnail = node.xpath_node(%q(.//div/span/img)).try &.["data-thumb"]? - playlist_thumbnail ||= node.xpath_node(%q(.//div/span/img)).try &.["src"] + playlist_thumbnail = node.xpath_node(%q(.//span/img)).try &.["data-thumb"]? + playlist_thumbnail ||= node.xpath_node(%q(.//span/img)).try &.["src"] items << SearchPlaylist.new( title,