From 62ae83656546c5733c8f62f7fa549da030ab1bd2 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 13 Sep 2018 21:00:39 -0500 Subject: [PATCH] Remove 'less' button in playlist descriptions --- src/invidious/playlists.cr | 9 +++++++-- src/invidious/views/playlist.ecr | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 1df4ffc42..6a0c6c385 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -119,13 +119,18 @@ end def fetch_playlist(plid) client = make_client(YT_URL) response = client.get("/playlist?list=#{plid}&disable_polymer=1") - document = XML.parse_html(response.body) + body = response.body.gsub(<<-END_BUTTON + + END_BUTTON + , "") + document = XML.parse_html(body) title = document.xpath_node(%q(//h1[@class="pl-header-title"])).not_nil!.content title = title.strip(" \n") description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1])) - description, description_html = html_to_content(description_html) + description_html, description = html_to_content(description_html) anchor = document.xpath_node(%q(//ul[@class="pl-header-details"])).not_nil! author = anchor.xpath_node(%q(.//li[1]/a)).not_nil!.content diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index f3d08ce97..4e93fc6f1 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -16,7 +16,7 @@
-

<%= playlist.description %>

+

<%= playlist.description_html %>

<% videos.each_slice(4) do |slice| %>