From 379761ab7b37038bdb7e95c48c16fce1ca1eab84 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Sun, 3 Dec 2023 17:20:36 -0800 Subject: [PATCH] Change "list" to "comp" --- src/invidious/compilations.cr | 4 ++-- src/invidious/routes/compilations.cr | 10 +++------- src/invidious/views/add_compilation_items.ecr | 4 ++-- src/invidious/views/compilation.ecr | 8 ++++---- src/invidious/views/components/item.ecr | 3 +-- src/invidious/views/edit_compilation.ecr | 6 +++--- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/invidious/compilations.cr b/src/invidious/compilations.cr index 0315f6ec..e3a4147f 100644 --- a/src/invidious/compilations.cr +++ b/src/invidious/compilations.cr @@ -452,7 +452,7 @@ end def template_compilation(compilation) html = <<-END_HTML

- + #{compilation["title"]}

@@ -463,7 +463,7 @@ def template_compilation(compilation) compilation["videos"].as_a.each do |video| html += <<-END_HTML
  • - +

    #{recode_length_seconds(video["lengthSeconds"].as_i)}

    diff --git a/src/invidious/routes/compilations.cr b/src/invidious/routes/compilations.cr index 4a8a17ca..0ccc67c1 100644 --- a/src/invidious/routes/compilations.cr +++ b/src/invidious/routes/compilations.cr @@ -52,7 +52,7 @@ module Invidious::Routes::Compilations compilation = create_compilation(title, privacy, user) - env.redirect "/compilation?list=#{compilation.id}" + env.redirect "/compilation?comp=#{compilation.id}" end def self.delete_page(env) @@ -264,7 +264,7 @@ module Invidious::Routes::Compilations update_first_video_params(compid) - env.redirect "/compilation?list=#{compid}" + env.redirect "/compilation?comp=#{compid}" end def self.add_compilation_items_page(env) @@ -496,7 +496,7 @@ module Invidious::Routes::Compilations user = env.get?("user").try &.as(User) referer = get_referer(env) - compid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") + compid = env.params.query["comp"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") if !compid return env.redirect "/" end @@ -504,10 +504,6 @@ module Invidious::Routes::Compilations page = env.params.query["page"]?.try &.to_i? page ||= 1 - if compid.starts_with? "RD" - return env.redirect "/mix?list=#{compid}" - end - begin compilation = get_compilation(compid) rescue ex : NotFoundException diff --git a/src/invidious/views/add_compilation_items.ecr b/src/invidious/views/add_compilation_items.ecr index e62e860c..d8874930 100644 --- a/src/invidious/views/add_compilation_items.ecr +++ b/src/invidious/views/add_compilation_items.ecr @@ -8,13 +8,13 @@
    diff --git a/src/invidious/views/compilation.ecr b/src/invidious/views/compilation.ecr index 7fa900a1..c1d994f9 100644 --- a/src/invidious/views/compilation.ecr +++ b/src/invidious/views/compilation.ecr @@ -13,23 +13,23 @@ <%- if compilation.is_a?(InvidiousCompilation) && compilation.author == user.try &.email -%> <%- if compilation.index.size > 0 -%> <%- end -%> diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index 2155d74c..c08bc7f5 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -59,7 +59,7 @@ if item.id.starts_with? "RD" link_url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}" elsif item.id.starts_with? "IVCMP" - link_url = "/compilation?list=#{item.id}" + link_url = "/compilation?comp=#{item.id}" else link_url = "/playlist?list=#{item.id}" end @@ -100,7 +100,6 @@ elsif item.is_a?(MixVideo) link_url = "/watch?v=#{item.id}&list=#{item.rdid}" endpoint_params = "?v=#{item.id}&list=#{item.rdid}" - # elsif item.is_a?(CompilationVideo) else link_url = "/watch?v=#{item.id}" endpoint_params = "?v=#{item.id}" diff --git a/src/invidious/views/edit_compilation.ecr b/src/invidious/views/edit_compilation.ecr index 94c3e180..b6ec7ce1 100644 --- a/src/invidious/views/edit_compilation.ecr +++ b/src/invidious/views/edit_compilation.ecr @@ -5,11 +5,11 @@ <% end %> -
    +