mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-26 07:23:37 +00:00
Use optional query for watch page
This commit is contained in:
parent
e2c50d4d1f
commit
10c1cfa4b5
@ -217,17 +217,13 @@ get "/watch" do |env|
|
||||
|
||||
authorized = env.get? "authorized"
|
||||
if authorized
|
||||
headers = HTTP::Headers.new
|
||||
headers["Cookie"] = env.request.headers["Cookie"]
|
||||
|
||||
sid = env.get("sid").as(String)
|
||||
|
||||
user = get_user(sid, client, headers, PG_DB)
|
||||
subscriptions = user.subscriptions
|
||||
else
|
||||
subscriptions = [] of String
|
||||
subscriptions = PG_DB.query_one?("SELECT subscriptions FROM users WHERE id = $1", sid, as: Array(String))
|
||||
end
|
||||
|
||||
subscriptions = [] of String
|
||||
|
||||
begin
|
||||
video = get_video(id, client, PG_DB)
|
||||
rescue ex
|
||||
|
Loading…
Reference in New Issue
Block a user