[Alternative] Fix for channel live videos
All checks were successful
Invidious CI / build (push) Successful in 6m30s
All checks were successful
Invidious CI / build (push) Successful in 6m30s
Signed-off-by: Fijxu <fijxu@nadeko.net> refactor Signed-off-by: Fijxu <fijxu@nadeko.net>
This commit is contained in:
parent
70dc1a9f11
commit
e3da8f408d
1 changed files with 24 additions and 7 deletions
|
@ -23,14 +23,31 @@ def produce_channel_content_continuation(ucid, content_type, page = 1, auto_gene
|
||||||
else 15 # Fallback to "videos"
|
else 15 # Fallback to "videos"
|
||||||
end
|
end
|
||||||
|
|
||||||
sort_by_numerical =
|
sort_type_numerical =
|
||||||
case sort_by
|
case content_type
|
||||||
when "newest" then 1_i64
|
when "videos" then 3
|
||||||
when "popular" then 2_i64
|
when "livestreams" then 5
|
||||||
when "oldest" then 4_i64
|
else 3 # Fallback to "videos"
|
||||||
else 1_i64 # Fallback to "newest"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if content_type == "livestreams"
|
||||||
|
sort_by_numerical =
|
||||||
|
case sort_by
|
||||||
|
when "newest" then 12_i64
|
||||||
|
when "popular" then 14_i64
|
||||||
|
when "oldest" then 13_i64
|
||||||
|
else 12_i64 # Fallback to "newest"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
sort_by_numerical =
|
||||||
|
case sort_by
|
||||||
|
when "newest" then 1_i64
|
||||||
|
when "popular" then 2_i64
|
||||||
|
when "oldest" then 4_i64
|
||||||
|
else 1_i64 # Fallback to "newest"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
object_inner_1 = {
|
object_inner_1 = {
|
||||||
"110:embedded" => {
|
"110:embedded" => {
|
||||||
"3:embedded" => {
|
"3:embedded" => {
|
||||||
|
@ -41,7 +58,7 @@ def produce_channel_content_continuation(ucid, content_type, page = 1, auto_gene
|
||||||
"2:embedded" => {
|
"2:embedded" => {
|
||||||
"1:string" => "00000000-0000-0000-0000-000000000000",
|
"1:string" => "00000000-0000-0000-0000-000000000000",
|
||||||
},
|
},
|
||||||
"3:varint" => sort_by_numerical,
|
"#{sort_type_numerical}:varint" => sort_by_numerical,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue