-
<% if content_type == 1 || content_type == 2 %>
+ <% # We really only need a single
(handled below) outside of content_type 1 or 2 %>
+
<% route = content_type == 1 ? "/videos" : "/playlists" %>
<% url = "/channel/#{channel.ucid + route}" %>
diff --git a/src/invidious/views/components/search-filters.ecr b/src/invidious/views/components/search-filters.ecr
new file mode 100644
index 00000000..c1c168a2
--- /dev/null
+++ b/src/invidious/views/components/search-filters.ecr
@@ -0,0 +1,130 @@
+<% operators = operators.not_nil! %>
+
+
+
+ <%= translate(locale, "filter") %>
+
+
+
+ <% filter_params = env.request.query_params.to_s.gsub(/q=.+?(?=&|$)/, "") %>
+ <% base_url = "/search?q=#{HTML.escape(query.not_nil!)}" %>
+
+
+ <%= translate(locale, "date") %>
+
+
+
+
+
+ <%= translate(locale, "content_type") %>
+
+
+
+
+
+ <%= translate(locale, "duration") %>
+
+
+
+
+
+ <%= translate(locale, "features") %>
+
+
+
+
+
+ <%= translate(locale, "sort") %>
+
+
+
+
+
\ No newline at end of file
diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr
index 896ceda6..b52df7d4 100644
--- a/src/invidious/views/search.ecr
+++ b/src/invidious/views/search.ecr
@@ -1,6 +1,18 @@
+<% is_channel_search = operators.fetch("channel", false) && channel.is_a? AboutChannel && !subscriptions.nil?%>
+
<% content_for "header" do %>
<%= search_query.not_nil!.size > 30 ? HTML.escape(query.not_nil![0,30].rstrip(".") + "...") : HTML.escape(query.not_nil!) %> - Invidious
+<% if is_channel_search %>
+
+<% end %>
+<% end %>
+
+<% # To satisfy the compiler we're going to need to repeat these two arguments %>
+<% if is_channel_search && channel.is_a? AboutChannel && !subscriptions.nil? %>
+ <% content_type = 7 %>
+ <% sort_options = Tuple.new %>
+ <%= rendered "components/channel-information" %>
<% end %>
<% if count == 0 %>
@@ -8,138 +20,15 @@
"><%= translate(locale, "Broken? Try another Invidious Instance!") %>
<% else %>
-
-
- <%= translate(locale, "filter") %>
-
-
-
- <% filter_params = env.request.query_params.to_s.gsub(/q=.+?(?=&|$)/, "") %>
- <% base_url = "/search?q=#{HTML.escape(query.not_nil!)}" %>
-
-
- <%= translate(locale, "date") %>
-
-
-
-
-
- <%= translate(locale, "content_type") %>
-
-
-
-
-
- <%= translate(locale, "duration") %>
-
-
-
-
-
- <%= translate(locale, "features") %>
-
-
-
-
-
- <%= translate(locale, "sort") %>
-
-
-
-
-
+ <% if is_channel_search %>
+ <% else %>
+ <%= rendered "components/search-filters" %>
+ <% end %>
<% end %>
<% if count == 0 %>
+<% elsif is_channel_search %>
<% else %>
<% end %>