diff --git a/assets/css/default.css b/assets/css/default.css index 9d2ab34b5..01d4b736c 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -880,4 +880,9 @@ h1, h2, h3, h4, h5, p, .error-card pre { height: 300px; +} + +.error-issue-template { + padding: 20px; + background: rgba(0, 0, 0, 0.12345); } \ No newline at end of file diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index 399324cdb..e2c4b650a 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -31,7 +31,7 @@ def get_issue_template(env : HTTP::Server::Context, exception : Exception) : Tup issue_template += github_details("Backtrace", exception.inspect_with_backtrace) - return {issue_title, issue_template} + return issue_title, issue_template end def error_template_helper(env : HTTP::Server::Context, status_code : Int32, exception : Exception) @@ -78,7 +78,7 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, exce
#{translate(locale, "crash_page_report_issue", url_new_issue)}
-#{issue_template}
+ #{issue_template}
END_HTML
diff --git a/src/invidious/helpers/serialized_yt_data.cr b/src/invidious/helpers/serialized_yt_data.cr
index a6501e413..2796a8dc6 100644
--- a/src/invidious/helpers/serialized_yt_data.cr
+++ b/src/invidious/helpers/serialized_yt_data.cr
@@ -320,7 +320,7 @@ struct ProblematicTimelineItem
def to_xml(env, locale, xml : XML::Builder)
xml.element("entry") do
- xml.element("id") { xml.text "iv-err-#{Random.new.base64(8)}" }
+ xml.element("id") { xml.text "iv-err-#{@id}" }
xml.element("title") { xml.text "Parse Error: This item has failed to parse" }
xml.element("updated") { xml.text Time.utc.to_rfc3339 }
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr
index c762b64b2..7c584d153 100644
--- a/src/invidious/playlists.cr
+++ b/src/invidious/playlists.cr
@@ -501,9 +501,7 @@ def extract_playlist_videos(initial_data : Hash(String, JSON::Any))
})
end
rescue ex
- videos << ProblematicTimelineItem.new(
- parse_exception: ex
- )
+ videos << ProblematicTimelineItem.new(parse_exception: ex)
end
return videos
diff --git a/src/invidious/routes/embed.cr b/src/invidious/routes/embed.cr
index b7ae4e0ec..930e4915a 100644
--- a/src/invidious/routes/embed.cr
+++ b/src/invidious/routes/embed.cr
@@ -13,14 +13,14 @@ module Invidious::Routes::Embed
raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url))
end
- get_first_video = videos[0].as(PlaylistVideo)
+ first_playlist_video = videos[0].as(PlaylistVideo)
rescue ex : NotFoundException
return error_template(404, ex)
rescue ex
return error_template(500, ex)
end
- url = "/embed/#{get_first_video}?#{env.params.query}"
+ url = "/embed/#{first_playlist_video}?#{env.params.query}"
if env.params.query.size > 0
url += "?#{env.params.query}"
@@ -75,14 +75,14 @@ module Invidious::Routes::Embed
raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url))
end
- get_first_video = videos[0].as(PlaylistVideo)
+ first_playlist_video = videos[0].as(PlaylistVideo)
rescue ex : NotFoundException
return error_template(404, ex)
rescue ex
return error_template(500, ex)
end
- url = "/embed/#{get_first_video.id}"
+ url = "/embed/#{first_playlist_video.id}"
elsif video_series
url = "/embed/#{video_series.shift}"
env.params.query["playlist"] = video_series.join(",")
diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr
index 279a74b23..a24423df9 100644
--- a/src/invidious/views/components/item.ecr
+++ b/src/invidious/views/components/item.ecr
@@ -106,7 +106,7 @@
<%=get_issue_template(env, item.parse_exception)[1]%>+
<%=get_issue_template(env, item.parse_exception)[1]%>