|
|
@ -350,6 +350,7 @@ get "/watch" do |env|
|
|
|
|
if user
|
|
|
|
if user
|
|
|
|
subscriptions = user.subscriptions
|
|
|
|
subscriptions = user.subscriptions
|
|
|
|
watched = user.watched
|
|
|
|
watched = user.watched
|
|
|
|
|
|
|
|
notifications = user.notifications
|
|
|
|
end
|
|
|
|
end
|
|
|
|
subscriptions ||= [] of String
|
|
|
|
subscriptions ||= [] of String
|
|
|
|
|
|
|
|
|
|
|
@ -377,6 +378,12 @@ get "/watch" do |env|
|
|
|
|
PG_DB.exec("UPDATE users SET watched = watched || $1 WHERE email = $2", [id], user.as(User).email)
|
|
|
|
PG_DB.exec("UPDATE users SET watched = watched || $1 WHERE email = $2", [id], user.as(User).email)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if notifications && notifications.includes? id
|
|
|
|
|
|
|
|
PG_DB.exec("UPDATE users SET notifications = array_remove(notifications, $1) WHERE email = $2", id, user.as(User).email)
|
|
|
|
|
|
|
|
env.get("user").as(User).notifications.delete(id)
|
|
|
|
|
|
|
|
notifications.delete(id)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if nojs
|
|
|
|
if nojs
|
|
|
|
if preferences
|
|
|
|
if preferences
|
|
|
|
source = preferences.comments[0]
|
|
|
|
source = preferences.comments[0]
|
|
|
@ -558,6 +565,7 @@ get "/embed/:id" do |env|
|
|
|
|
if user
|
|
|
|
if user
|
|
|
|
subscriptions = user.subscriptions
|
|
|
|
subscriptions = user.subscriptions
|
|
|
|
watched = user.watched
|
|
|
|
watched = user.watched
|
|
|
|
|
|
|
|
notifications = user.notifications
|
|
|
|
end
|
|
|
|
end
|
|
|
|
subscriptions ||= [] of String
|
|
|
|
subscriptions ||= [] of String
|
|
|
|
|
|
|
|
|
|
|
@ -580,6 +588,12 @@ get "/embed/:id" do |env|
|
|
|
|
PG_DB.exec("UPDATE users SET watched = watched || $1 WHERE email = $2", [id], user.as(User).email)
|
|
|
|
PG_DB.exec("UPDATE users SET watched = watched || $1 WHERE email = $2", [id], user.as(User).email)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if notifications && notifications.includes? id
|
|
|
|
|
|
|
|
PG_DB.exec("UPDATE users SET notifications = array_remove(notifications, $1) WHERE email = $2", id, user.as(User).email)
|
|
|
|
|
|
|
|
env.get("user").as(User).notifications.delete(id)
|
|
|
|
|
|
|
|
notifications.delete(id)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
fmt_stream = video.fmt_stream(decrypt_function)
|
|
|
|
fmt_stream = video.fmt_stream(decrypt_function)
|
|
|
|
adaptive_fmts = video.adaptive_fmts(decrypt_function)
|
|
|
|
adaptive_fmts = video.adaptive_fmts(decrypt_function)
|
|
|
|
|
|
|
|
|
|
|
|