mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add 'views' to channel_videos
This commit is contained in:
parent
52cb239194
commit
64464f23ae
5 changed files with 22 additions and 9 deletions
|
@ -2857,6 +2857,7 @@ post "/feed/webhook/:token" do |env|
|
|||
length_seconds: video.length_seconds,
|
||||
live_now: video.live_now,
|
||||
premiere_timestamp: video.premiere_timestamp,
|
||||
views: video.views,
|
||||
)
|
||||
|
||||
users = PG_DB.query_all("UPDATE users SET notifications = notifications || $1 \
|
||||
|
@ -2866,10 +2867,10 @@ post "/feed/webhook/:token" do |env|
|
|||
video_array = video.to_a
|
||||
args = arg_array(video_array)
|
||||
|
||||
PG_DB.exec("INSERT INTO channel_videos VALUES (#{args}) \
|
||||
PG_DB.exec("INSERT INTO channel_videos (id, title, published, updated, ucid, author, length_seconds, live_now, premiere_timestamp) VALUES (#{args}) \
|
||||
ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
|
||||
updated = $4, ucid = $5, author = $6, length_seconds = $7, \
|
||||
live_now = $8, premiere_timestamp = $9", video_array)
|
||||
live_now = $8, premiere_timestamp = $9, views = $10", video_array)
|
||||
|
||||
users.each do |user|
|
||||
payload = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue