mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-13 16:18:29 +00:00
Add author_verified property to SearchVideo
This commit is contained in:
parent
885120bd08
commit
d3482831c8
@ -1302,6 +1302,7 @@ get "/feed/channel/:ucid" do |env|
|
||||
title: title,
|
||||
id: video_id,
|
||||
author: author,
|
||||
author_verified: false,
|
||||
ucid: ucid,
|
||||
published: published,
|
||||
views: views,
|
||||
|
@ -265,6 +265,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
|
||||
live_now = false
|
||||
paid = false
|
||||
premium = false
|
||||
author_verified = false
|
||||
|
||||
premiere_timestamp = i["upcomingEventData"]?.try &.["startTime"]?.try { |t| Time.unix(t.as_s.to_i64) }
|
||||
|
||||
@ -284,10 +285,21 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
|
||||
end
|
||||
end
|
||||
|
||||
# Author Badges
|
||||
i["ownerBadges"]?.try &.as_a.each do |badge|
|
||||
b = badge["metadataBadgeRenderer"]
|
||||
case b["style"].as_s
|
||||
when "BADGE_STYLE_TYPE_VERIFIED"
|
||||
author_verified = true
|
||||
else nil
|
||||
end
|
||||
end
|
||||
|
||||
SearchVideo.new({
|
||||
title: title,
|
||||
id: video_id,
|
||||
author: author,
|
||||
author_verified: author_verified,
|
||||
ucid: author_id,
|
||||
published: published,
|
||||
views: view_count,
|
||||
|
@ -4,6 +4,7 @@ struct SearchVideo
|
||||
property title : String
|
||||
property id : String
|
||||
property author : String
|
||||
property author_verified : Bool
|
||||
property ucid : String
|
||||
property published : Time
|
||||
property views : Int64
|
||||
|
Loading…
Reference in New Issue
Block a user