Minor fixes

This commit is contained in:
Samantaz Fox 2022-06-07 19:08:48 +02:00
parent 0e40b23d46
commit e6bc502104
No known key found for this signature in database
GPG key ID: F42821059186176E

View file

@ -59,9 +59,6 @@ module Invidious::RssAtom
id : String, id : String,
properties : AtomProperties properties : AtomProperties
) )
locale = env.get("preferences").as(Preferences).locale
params = HTTP::Params.parse(env.params.query["params"]? || "")
return XML.build(indent: " ", encoding: "UTF-8") do |xml| return XML.build(indent: " ", encoding: "UTF-8") do |xml|
xml.element("feed", xml.element("feed",
xmlns: "http://www.w3.org/2005/Atom", xmlns: "http://www.w3.org/2005/Atom",
@ -111,7 +108,7 @@ module Invidious::RssAtom
# Video entries # Video entries
videos.each do |video| videos.each do |video|
xml.element("entry") { atom_video(xml, video, params) } xml.element("entry") { atom_video(xml, video, env.params.query) }
end end
end end
end end
@ -122,7 +119,7 @@ module Invidious::RssAtom
video_url = "#{HOST_URL}/watch?v=#{video.id}&#{query_params}" video_url = "#{HOST_URL}/watch?v=#{video.id}&#{query_params}"
video_thumb = "#{HOST_URL}/vi/#{video.id}/mqdefault.jpg" video_thumb = "#{HOST_URL}/vi/#{video.id}/mqdefault.jpg"
description = video.is_a?(SearchVideo) ? video.description_html : "" description = video.is_a?(SearchVideo) ? video.description_html.gsub('\n', "<br/>\n") : ""
xml.element("id") { xml.text "ni://invidious/sha-256;" + sha256("video/#{video.id}") } xml.element("id") { xml.text "ni://invidious/sha-256;" + sha256("video/#{video.id}") }
xml.element("title") { xml.text video.title } xml.element("title") { xml.text video.title }