From 19bf0ccbf0625f0f8ac24fe7c024417c0ed5ae81 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 26 Nov 2018 10:50:34 -0600 Subject: [PATCH] Add /feed/top and /feed/popular --- src/invidious.cr | 8 ++++++++ src/invidious/views/popular.ecr | 7 +++++++ src/invidious/views/top.ecr | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 src/invidious/views/popular.ecr create mode 100644 src/invidious/views/top.ecr diff --git a/src/invidious.cr b/src/invidious.cr index 5fa57ea4..ef4214d0 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1669,6 +1669,14 @@ end # Feeds +get "/feed/top" do |env| + templated "top" +end + +get "/feed/popular" do |env| + templated "popular" +end + get "/feed/trending" do |env| trending_type = env.params.query["type"]? region = env.params.query["region"]? diff --git a/src/invidious/views/popular.ecr b/src/invidious/views/popular.ecr new file mode 100644 index 00000000..6cd3d8d6 --- /dev/null +++ b/src/invidious/views/popular.ecr @@ -0,0 +1,7 @@ +
+<% popular_videos.each_slice(4) do |slice| %> + <% slice.each do |item| %> + <%= rendered "components/item" %> + <% end %> +<% end %> +
diff --git a/src/invidious/views/top.ecr b/src/invidious/views/top.ecr new file mode 100644 index 00000000..4dfc3b64 --- /dev/null +++ b/src/invidious/views/top.ecr @@ -0,0 +1,7 @@ +
+<% top_videos.each_slice(4) do |slice| %> + <% slice.each do |item| %> + <%= rendered "components/item" %> + <% end %> +<% end %> +