Complete the bifurcation of "list" and "comp"

This commit is contained in:
broquemonsieur 2023-12-03 18:44:07 -08:00
parent 379761ab7b
commit df188c032c
7 changed files with 15 additions and 23 deletions

View File

@ -16,7 +16,7 @@ function get_compilation(compid) {
player.on('ended', function () { player.on('ended', function () {
var url = new URL('https://example.com/embed/' + response.nextVideo); var url = new URL('https://example.com/embed/' + response.nextVideo);
url.searchParams.set('list', compid); url.searchParams.set('comp', compid);
if (!compid.startsWith('RD')) if (!compid.startsWith('RD'))
url.searchParams.set('index', response.index); url.searchParams.set('index', response.index);
if (video_data.params.autoplay || video_data.params.continue_autoplay) if (video_data.params.autoplay || video_data.params.continue_autoplay)

View File

@ -73,7 +73,7 @@ function get_compilation(compid) {
player.on('ended', function () { player.on('ended', function () {
var url = new URL('https://example.com/watch?v=' + response.nextVideo); var url = new URL('https://example.com/watch?v=' + response.nextVideo);
url.searchParams.set('list', compid); url.searchParams.set('comp', compid);
if (!compid.startsWith('RD')) if (!compid.startsWith('RD'))
url.searchParams.set('index', response.index); url.searchParams.set('index', response.index);
if (video_data.params.autoplay || video_data.params.continue_autoplay) if (video_data.params.autoplay || video_data.params.continue_autoplay)

View File

@ -457,7 +457,7 @@ jobs:
## Accepted values: a string ## Accepted values: a string
## Default: <none> ## Default: <none>
## ##
hmac_key: "CHANGE_ME!!" hmac_key: "83646b9f96e6823d2c6e275911ade98f5e9436fa"
## ##
## List of video IDs where the "download" widget must be ## List of video IDs where the "download" widget must be

View File

@ -30,7 +30,7 @@ services:
# domain: # domain:
# https_only: false # https_only: false
# statistics_enabled: false # statistics_enabled: false
hmac_key: "CHANGE_ME!!" hmac_key: "83646b9f96e6823d2c6e275911ade98f5e9436fa"
healthcheck: healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1 test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
interval: 30s interval: 30s

View File

@ -67,7 +67,7 @@ module Invidious::Routes::Compilations
user = user.as(User) user = user.as(User)
sid = sid.as(String) sid = sid.as(String)
compid = env.params.query["list"]? compid = env.params.query["comp"]?
if !compid || compid.empty? if !compid || compid.empty?
return error_template(400, "A compilation ID is required") return error_template(400, "A compilation ID is required")
end end
@ -91,7 +91,7 @@ module Invidious::Routes::Compilations
return env.redirect "/" if user.nil? return env.redirect "/" if user.nil?
compid = env.params.query["list"]? compid = env.params.query["comp"]?
return env.redirect referer if compid.nil? return env.redirect referer if compid.nil?
user = user.as(User) user = user.as(User)
@ -126,7 +126,7 @@ module Invidious::Routes::Compilations
user = user.as(User) user = user.as(User)
sid = sid.as(String) sid = sid.as(String)
compid = env.params.query["list"]? compid = env.params.query["comp"]?
if !compid || !compid.starts_with?("IVCMP") if !compid || !compid.starts_with?("IVCMP")
return env.redirect referer return env.redirect referer
end end
@ -159,7 +159,7 @@ module Invidious::Routes::Compilations
return env.redirect "/" if user.nil? return env.redirect "/" if user.nil?
compid = env.params.query["list"]? compid = env.params.query["comp"]?
return env.redirect referer if compid.nil? return env.redirect referer if compid.nil?
user = user.as(User) user = user.as(User)
@ -191,7 +191,7 @@ module Invidious::Routes::Compilations
Invidious::Database::Compilations.update(compid, title, privacy, description, updated) Invidious::Database::Compilations.update(compid, title, privacy, description, updated)
env.redirect "/compilation?list=#{compid}" env.redirect "/compilation?comp=#{compid}"
end end
def self.adjust_timestamps(env) def self.adjust_timestamps(env)
@ -204,7 +204,7 @@ module Invidious::Routes::Compilations
return env.redirect "/" if user.nil? return env.redirect "/" if user.nil?
compid = env.params.query["list"]? compid = env.params.query["comp"]?
return env.redirect referer if compid.nil? return env.redirect referer if compid.nil?
user = user.as(User) user = user.as(User)
@ -282,7 +282,7 @@ module Invidious::Routes::Compilations
user = user.as(User) user = user.as(User)
sid = sid.as(String) sid = sid.as(String)
compid = env.params.query["list"]? compid = env.params.query["comp"]?
if !compid || !compid.starts_with?("IVCMP") if !compid || !compid.starts_with?("IVCMP")
return env.redirect referer return env.redirect referer
end end
@ -304,7 +304,7 @@ module Invidious::Routes::Compilations
query_encoded = URI.encode_www_form(query.try &.text || "", space_to_plus: true) query_encoded = URI.encode_www_form(query.try &.text || "", space_to_plus: true)
page_nav_html = Frontend::Pagination.nav_numeric(locale, page_nav_html = Frontend::Pagination.nav_numeric(locale,
base_url: "/add_compilation_items?list=#{compilation.id}&q=#{query_encoded}", base_url: "/add_compilation_items?comp=#{compilation.id}&q=#{query_encoded}",
current_page: page, current_page: page,
show_next: (items.size >= 20) show_next: (items.size >= 20)
) )
@ -516,7 +516,7 @@ module Invidious::Routes::Compilations
page_count += 1 if (compilation.video_count % 200) > 0 page_count += 1 if (compilation.video_count % 200) > 0
if page > page_count if page > page_count
return env.redirect "/compilation?list=#{compid}&page=#{page_count}" return env.redirect "/compilation?comp=#{compid}&page=#{page_count}"
end end
if compilation.privacy == CompilationPrivacy::Private && compilation.author != user.try &.email if compilation.privacy == CompilationPrivacy::Private && compilation.author != user.try &.email

View File

@ -41,8 +41,8 @@ module Invidious::Routes::Watch
if env.params.query["list"]?.try &.starts_with? "IVPL" if env.params.query["list"]?.try &.starts_with? "IVPL"
plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
continuation = process_continuation(env.params.query, plid, id) continuation = process_continuation(env.params.query, plid, id)
elsif env.params.query["list"]?.try &.starts_with? "IVCMP" elsif env.params.query["comp"]?.try &.starts_with? "IVCMP"
compid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") compid = env.params.query["comp"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
if (!compid.nil?) if (!compid.nil?)
index = Invidious::Database::CompilationVideos.select_index(compid, id) index = Invidious::Database::CompilationVideos.select_index(compid, id)
indices_array = Invidious::Database::Compilations.select_index_array(compid) indices_array = Invidious::Database::Compilations.select_index_array(compid)

View File

@ -58,11 +58,3 @@
<% end %> <% end %>
</div> </div>
</form> </form>