Move author and ucid into schema

pull/3/head
Omar Roth 2018-06-01 17:24:16 -05:00
rodzic cbe10784aa
commit a2e23f7022
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -15,6 +15,8 @@ CREATE TABLE public.videos
published timestamp with time zone,
description 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)
)
WITH (

Wyświetl plik

@ -76,6 +76,8 @@ class Video
published: Time,
description: String,
language: String?,
author: String,
ucid: String,
})
end
@ -194,8 +196,9 @@ def fetch_video(id, client)
end
title = info["title"]
views = info["view_count"].to_i64
author = info["author"]
ucid = info["ucid"]
likes = html.xpath_node(%q(//button[@title="I like this"]/span))
likes = likes.try &.content.delete(",").try &.to_i
@ -238,7 +241,7 @@ def fetch_video(id, client)
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
end