From f8b29674b2f09c46b74f435a485bebd04c8ce73d Mon Sep 17 00:00:00 2001 From: jonas-w Date: Mon, 7 Feb 2022 02:25:34 +0100 Subject: [PATCH] Gave them marks some space and added nil checks --- src/invidious/comments.cr | 2 +- src/invidious/views/channel.ecr | 2 +- src/invidious/views/community.ecr | 2 +- src/invidious/views/components/item.ecr | 8 ++++---- src/invidious/views/playlists.ecr | 2 +- src/invidious/views/watch.ecr | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 7d52b918..c8533c30 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -330,7 +330,7 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false) author_name = HTML.escape(child["author"].as_s) if child["verified"]?.try &.as_bool - author_name += "" + author_name += " " end html << <<-END_HTML
diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index a32a2eed..197c636b 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -20,7 +20,7 @@
- <%= author %><% if channel.verified %><% end %> + <%= author %><% if !channel.verified.nil? && channel.verified %> <% end %>
diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 7b002f04..10ac5f04 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -19,7 +19,7 @@
- <%= author %><% if channel.verified %><% end %> + <%= author %><% if !channel.verified.nil? && channel.verified %> <% end %>
diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index bc59233f..8b8df07f 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -8,7 +8,7 @@ "/> <% end %> -

<%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %><% end %>

+

<%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %> <% end %>

<%= translate_count(locale, "generic_subscribers_count", item.subscriber_count, NumberFormatting::Separator) %>

<% if !item.auto_generated %>

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

<% end %> @@ -30,7 +30,7 @@

<%= HTML.escape(item.title) %>

-

<%= HTML.escape(item.author) %><% if !item.is_a?(InvidiousPlaylist) && !item.author_verified.nil? && item.author_verified %><% end %>

+

<%= HTML.escape(item.author) %><% if !item.is_a?(InvidiousPlaylist) && !item.author_verified.nil? && item.author_verified %> <% end %>

<% when MixVideo %> @@ -45,7 +45,7 @@

<%= HTML.escape(item.title) %>

-

<%= HTML.escape(item.author) %><% if !item.is_a?(MixVideo) && !item.author_verified.nil? && item.author_verified %><% end %>

+

<%= HTML.escape(item.author) %><% if !item.is_a?(MixVideo) && !item.author_verified.nil? && item.author_verified %> <% end %>

<% when PlaylistVideo %> @@ -142,7 +142,7 @@
<% endpoint_params = "?v=#{item.id}" %> diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 63badf76..94d7a753 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -19,7 +19,7 @@
- <%= author %><% if channel.verified %><% end %> + <%= author %><% if !channel.verified.nil? && channel.verified %> <% end %>
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 496ceddc..4593affc 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -240,7 +240,7 @@ we're going to need to do it here in order to allow for translations. <% if !video.author_thumbnail.empty? %> <% end %> - <%= author %><% if video.author_verified %><% end %> + <%= author %><% if !video.author_verified.nil? && video.author_verified %> <% end %>
@@ -314,9 +314,9 @@ we're going to need to do it here in order to allow for translations.
<% if rv["ucid"]? %> - "><%= rv["author"]? %><% if rv["author_verified"].== "true" %><% end %> + "><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <% end %> <% else %> - <%= rv["author"]? %><% if rv["author_verified"].== "true" %><% end %> + <%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <% end %> <% end %>