mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Move author and ucid into schema
This commit is contained in:
parent
cbe10784aa
commit
a2e23f7022
2 changed files with 7 additions and 2 deletions
|
@ -15,6 +15,8 @@ CREATE TABLE public.videos
|
||||||
published timestamp with time zone,
|
published timestamp with time zone,
|
||||||
description text COLLATE pg_catalog."default",
|
description text COLLATE pg_catalog."default",
|
||||||
language text COLLATE pg_catalog."default",
|
language text COLLATE pg_catalog."default",
|
||||||
|
author text COLLATE pg_catalog."default",
|
||||||
|
ucid text COLLATE pg_catalog."default",
|
||||||
CONSTRAINT videos_pkey PRIMARY KEY (id)
|
CONSTRAINT videos_pkey PRIMARY KEY (id)
|
||||||
)
|
)
|
||||||
WITH (
|
WITH (
|
||||||
|
|
|
@ -76,6 +76,8 @@ class Video
|
||||||
published: Time,
|
published: Time,
|
||||||
description: String,
|
description: String,
|
||||||
language: String?,
|
language: String?,
|
||||||
|
author: String,
|
||||||
|
ucid: String,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,8 +196,9 @@ def fetch_video(id, client)
|
||||||
end
|
end
|
||||||
|
|
||||||
title = info["title"]
|
title = info["title"]
|
||||||
|
|
||||||
views = info["view_count"].to_i64
|
views = info["view_count"].to_i64
|
||||||
|
author = info["author"]
|
||||||
|
ucid = info["ucid"]
|
||||||
|
|
||||||
likes = html.xpath_node(%q(//button[@title="I like this"]/span))
|
likes = html.xpath_node(%q(//button[@title="I like this"]/span))
|
||||||
likes = likes.try &.content.delete(",").try &.to_i
|
likes = likes.try &.content.delete(",").try &.to_i
|
||||||
|
@ -238,7 +241,7 @@ def fetch_video(id, client)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
video = Video.new(id, info, Time.now, title, views, likes, dislikes, wilson_score, published, description, nil)
|
video = Video.new(id, info, Time.now, title, views, likes, dislikes, wilson_score, published, description, nil, author, ucid)
|
||||||
|
|
||||||
return video
|
return video
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue