diff --git a/locales/en-US.json b/locales/en-US.json index 88daa4eb..7e836546 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -384,6 +384,7 @@ "Download": "Download", "Download as: ": "Download as: ", "%A %B %-d, %Y": "%A %B %-d, %Y", + "%B %-d, %Y": "%B %-d, %Y", "(edited)": "(edited)", "YouTube comment permalink": "YouTube comment permalink", "permalink": "permalink", @@ -423,5 +424,9 @@ "Current version: ": "Current version: ", "next_steps_error_message": "After which you should try to: ", "next_steps_error_message_refresh": "Refresh", - "next_steps_error_message_go_to_youtube": "Go to Youtube" + "next_steps_error_message_go_to_youtube": "Go to Youtube", + "Details": "Details", + "Stats": "Stats", + "Joined": "Joined", + "Links": "Links", } diff --git a/src/invidious.cr b/src/invidious.cr index 0ab526f8..7e7e238a 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1674,11 +1674,6 @@ get "/user/:user/about" do |env| env.redirect "/channel/#{user}" end -get "/channel/:ucid/about" do |env| - ucid = env.params.url["ucid"] - env.redirect "/channel/#{ucid}" -end - get "/channel/:ucid" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -1825,6 +1820,31 @@ get "/channel/:ucid/community" do |env| templated "community" end +get "/channel/:ucid/about" do |env| + locale = LOCALES[env.get("preferences").as(Preferences).locale]? + + user = env.get? "user" + if user + user = user.as(User) + subscriptions = user.subscriptions + end + subscriptions ||= [] of String + + ucid = env.params.url["ucid"] + + continuation = env.params.query["continuation"]? + + begin + channel = get_about_info(ucid, locale) + rescue ex : ChannelRedirect + next env.redirect env.request.resource.gsub(ucid, ex.channel_id) + rescue ex + next error_template(500, ex) + end + + templated "channel_about" +end + # API Endpoints get "/api/v1/stats" do |env| diff --git a/src/invidious/views/channel_about.ecr b/src/invidious/views/channel_about.ecr new file mode 100644 index 00000000..8272c1ea --- /dev/null +++ b/src/invidious/views/channel_about.ecr @@ -0,0 +1,35 @@ +<% content_type = 4 %> +<% sort_options = Tuple.new %> +<%= rendered "components/channel-information" %> + +
Country: <%=channel.country%>
+<%= translate(locale, "Joined") %> + +
+<%= channel.total_views ? translate(locale, "`x` views", number_with_separator(channel.total_views || 0)) : "" %>
+