diff --git a/assets/css/channel.css b/assets/css/channel.css index d4aefca8..db98dca8 100644 --- a/assets/css/channel.css +++ b/assets/css/channel.css @@ -50,3 +50,10 @@ #link-widget-primary a:hover { color: #e1e1e1 !important; } + +/* Center sorting options when screen is less than 640px*/ +@media screen and (max-width: 640px) { + #sort-options { + margin-right: auto; + } +} diff --git a/assets/css/default.css b/assets/css/default.css index 6c858646..e2c8a692 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -567,5 +567,16 @@ p, #content-navigation { - margin-bottom: 0.5em; + margin-bottom: 0.5em; + display: flex; + overflow-x: scroll; + overflow-y: hidden; + white-space: nowrap; + + -ms-overflow-style: none; + scrollbar-width: none; } + +#content-navigation::-webkit-scrollbar { + display: none; /* Safari and Chrome */ +} \ No newline at end of file diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index a797056f..e1f708c0 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -7,6 +7,7 @@ module Invidious::Routes::Channels def self.videos(env) data = self.fetch_basic_information(env) + if !data.is_a?(Tuple) return data end @@ -48,6 +49,7 @@ module Invidious::Routes::Channels end locale, user, subscriptions, continuation, ucid, channel = data + sort_options = {"last", "oldest", "newest"} sort_by = env.params.query["sort_by"]?.try &.downcase sort_by ||= "last" @@ -104,9 +106,9 @@ module Invidious::Routes::Channels begin channel = get_about_info(ucid, locale) rescue ex : ChannelRedirect - next env.redirect env.request.resource.gsub(ucid, ex.channel_id) + return env.redirect env.request.resource.gsub(ucid, ex.channel_id) rescue ex - next error_template(500, ex) + return error_template(500, ex) end templated "channel/about" @@ -157,11 +159,11 @@ module Invidious::Routes::Channels end end - private def search(env) + def self.search(env) return env.redirect "/search?#{env.params.query}&channel=#{env.params.url["ucid"]}" end - private def fetch_basic_information(env) + private def self.fetch_basic_information(env) locale = LOCALES[env.get("preferences").as(Preferences).locale]? user = env.get? "user" diff --git a/src/invidious/views/channel/channel.ecr b/src/invidious/views/channel/channel.ecr index 7a61acef..42e68d49 100644 --- a/src/invidious/views/channel/channel.ecr +++ b/src/invidious/views/channel/channel.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= channel.author %> - Invidious +<%= HTML.escape(channel.author) %> - Invidious <% end %> diff --git a/src/invidious/views/channel/community.ecr b/src/invidious/views/channel/community.ecr index 3bb778e8..636753f5 100644 --- a/src/invidious/views/channel/community.ecr +++ b/src/invidious/views/channel/community.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= channel.author %> - Invidious +<%= HTML.escape(channel.author) %> - Invidious <% end %> diff --git a/src/invidious/views/channel/playlists.ecr b/src/invidious/views/channel/playlists.ecr index 99732977..9ac16699 100644 --- a/src/invidious/views/channel/playlists.ecr +++ b/src/invidious/views/channel/playlists.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= channel.author %> - Invidious +<%= HTML.escape(channel.author) %> - Invidious <% end %> diff --git a/src/invidious/views/components/channels/channel-information.ecr b/src/invidious/views/components/channels/channel-information.ecr index 19b24d08..4827e511 100644 --- a/src/invidious/views/components/channels/channel-information.ecr +++ b/src/invidious/views/components/channels/channel-information.ecr @@ -1,3 +1,5 @@ +<% author = HTML.escape(channel.author) %> + <% if channel.banner %>