mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-16 09:58:50 +00:00
Carry over audio-only mode in playlist links
This commit is contained in:
@@ -42,6 +42,9 @@ module Invidious::Routes::API::V1::Misc
|
||||
format = env.params.query["format"]?
|
||||
format ||= "json"
|
||||
|
||||
listenParam = env.params.query["listen"]?
|
||||
listen = (listenParam == "true" || listenParam == "1")
|
||||
|
||||
if plid.starts_with? "RD"
|
||||
return env.redirect "/api/v1/mixes/#{plid}"
|
||||
end
|
||||
@@ -85,7 +88,7 @@ module Invidious::Routes::API::V1::Misc
|
||||
end
|
||||
|
||||
if format == "html"
|
||||
playlist_html = template_playlist(json_response)
|
||||
playlist_html = template_playlist(json_response, listen)
|
||||
index, next_video = json_response["videos"].as_a.skip(1 + lookback).select { |video| !video["author"].as_s.empty? }[0]?.try { |v| {v["index"], v["videoId"]} } || {nil, nil}
|
||||
|
||||
response = {
|
||||
@@ -111,6 +114,9 @@ module Invidious::Routes::API::V1::Misc
|
||||
format = env.params.query["format"]?
|
||||
format ||= "json"
|
||||
|
||||
listenParam = env.params.query["listen"]?
|
||||
listen = (listenParam == "true" || listenParam == "1")
|
||||
|
||||
begin
|
||||
mix = fetch_mix(rdid, continuation, locale: locale)
|
||||
|
||||
@@ -157,7 +163,7 @@ module Invidious::Routes::API::V1::Misc
|
||||
|
||||
if format == "html"
|
||||
response = JSON.parse(response)
|
||||
playlist_html = template_mix(response)
|
||||
playlist_html = template_mix(response, listen)
|
||||
next_video = response["videos"].as_a.select { |video| !video["author"].as_s.empty? }[0]?.try &.["videoId"]
|
||||
|
||||
response = {
|
||||
|
||||
Reference in New Issue
Block a user