Add support for verified badges on video results

This commit is contained in:
syeopite 2021-04-06 01:28:18 -07:00
parent d3482831c8
commit 9188d7c52b
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
3 changed files with 7 additions and 0 deletions

View File

@ -1550,6 +1550,7 @@ post "/feed/webhook/:token" do |env|
updated: updated,
ucid: video.ucid,
author: author,
author_verified: false,
length_seconds: video.length_seconds,
live_now: video.live_now,
premiere_timestamp: video.premiere_timestamp,

View File

@ -17,6 +17,7 @@ struct ChannelVideo
property updated : Time
property ucid : String
property author : String
property author_verified : Bool = false
property length_seconds : Int32 = 0
property live_now : Bool = false
property premiere_timestamp : Time? = nil
@ -275,6 +276,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
updated: Time.utc,
ucid: ucid,
author: author,
author_verified: false,
length_seconds: length_seconds,
live_now: live_now,
premiere_timestamp: premiere_timestamp,
@ -318,6 +320,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
updated: Time.utc,
ucid: video.ucid,
author: video.author,
author_verified: video.author_verified,
length_seconds: video.length_seconds,
live_now: video.live_now,
premiere_timestamp: video.premiere_timestamp,

View File

@ -140,6 +140,9 @@
<p style="display: flex;">
<b style="flex: 1;">
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
<% if item.author_verified %>
<a class="channel_badge"><i class="icon ion-md-checkmark-circle"></i></a>
<% end %>
</b>
<a title="<%=translate(locale, "Watch on YouTube")%>" href="https://www.youtube.com/watch?v=<%= item.id %>" style="margin-right: 5px;">
<i class="icon ion-logo-youtube"></i>