summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-11-25 18:16:56 -0600
committerOmar Roth <omarroth@hotmail.com>2018-11-25 18:16:56 -0600
commit9ce02e579d8f70862788f7af57007647bd4970c1 (patch)
treecf0d5c09ca52aabd41a7731faa15cf37d38c2824 /src
parent32e4ad078435baa4f8a3c552ca3ad516f247e831 (diff)
downloadinvidious-9ce02e579d8f70862788f7af57007647bd4970c1.tar.gz
invidious-9ce02e579d8f70862788f7af57007647bd4970c1.tar.bz2
invidious-9ce02e579d8f70862788f7af57007647bd4970c1.zip
Update '/api/v1/popular'
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index cd1da476..5fa57ea4 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2617,20 +2617,13 @@ get "/api/v1/popular" do |env|
generate_thumbnails(json, video.id)
end
- json.field "lengthSeconds", video.info["length_seconds"].to_i
- json.field "viewCount", video.views
+ json.field "lengthSeconds", video.length_seconds
json.field "author", video.author
json.field "authorId", video.ucid
json.field "authorUrl", "/channel/#{video.ucid}"
json.field "published", video.published.to_unix
json.field "publishedText", "#{recode_date(video.published)} ago"
-
- description = video.description.gsub("<br>", "\n")
- description = description.gsub("<br/>", "\n")
- description = XML.parse_html(description)
- json.field "description", description.content
- json.field "descriptionHtml", video.description
end
end
end