mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add 'since' to '/api/v1/auth/notifications'
This commit is contained in:
parent
ef309bd8d0
commit
54d250bde4
3 changed files with 69 additions and 25 deletions
|
@ -9,6 +9,34 @@ struct InvidiousChannel
|
|||
end
|
||||
|
||||
struct ChannelVideo
|
||||
def to_json(locale, config, kemal_config, json : JSON::Builder)
|
||||
json.object do
|
||||
json.field "title", self.title
|
||||
json.field "videoId", self.id
|
||||
json.field "videoThumbnails" do
|
||||
generate_thumbnails(json, self.id, config, Kemal.config)
|
||||
end
|
||||
|
||||
json.field "lengthSeconds", self.length_seconds
|
||||
|
||||
json.field "author", self.author
|
||||
json.field "authorId", self.ucid
|
||||
json.field "authorUrl", "/channel/#{self.ucid}"
|
||||
json.field "published", self.published.to_unix
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
|
||||
end
|
||||
end
|
||||
|
||||
def to_json(locale, config, kemal_config, json : JSON::Builder | Nil = nil)
|
||||
if json
|
||||
to_json(locale, config, kemal_config, json)
|
||||
else
|
||||
JSON.build do |json|
|
||||
to_json(locale, config, kemal_config, json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
db_mapping({
|
||||
id: String,
|
||||
title: String,
|
||||
|
|
|
@ -262,8 +262,10 @@ struct Video
|
|||
generate_storyboards(json, self.storyboards, config, kemal_config)
|
||||
end
|
||||
|
||||
json.field "description", html_to_content(self.description).last
|
||||
json.field "descriptionHtml", html_to_content(self.description).first
|
||||
description_html, description = html_to_content(self.description)
|
||||
|
||||
json.field "description", description
|
||||
json.field "descriptionHtml", description_html
|
||||
json.field "published", self.published.to_unix
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale))
|
||||
json.field "keywords", self.keywords
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue