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,
|
title: title,
|
||||||
id: video_id,
|
id: video_id,
|
||||||
author: author,
|
author: author,
|
||||||
|
author_verified: false,
|
||||||
ucid: ucid,
|
ucid: ucid,
|
||||||
published: published,
|
published: published,
|
||||||
views: views,
|
views: views,
|
||||||
|
@ -265,6 +265,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
|
|||||||
live_now = false
|
live_now = false
|
||||||
paid = false
|
paid = false
|
||||||
premium = false
|
premium = false
|
||||||
|
author_verified = false
|
||||||
|
|
||||||
premiere_timestamp = i["upcomingEventData"]?.try &.["startTime"]?.try { |t| Time.unix(t.as_s.to_i64) }
|
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
|
||||||
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({
|
SearchVideo.new({
|
||||||
title: title,
|
title: title,
|
||||||
id: video_id,
|
id: video_id,
|
||||||
author: author,
|
author: author,
|
||||||
|
author_verified: author_verified,
|
||||||
ucid: author_id,
|
ucid: author_id,
|
||||||
published: published,
|
published: published,
|
||||||
views: view_count,
|
views: view_count,
|
||||||
|
@ -4,6 +4,7 @@ struct SearchVideo
|
|||||||
property title : String
|
property title : String
|
||||||
property id : String
|
property id : String
|
||||||
property author : String
|
property author : String
|
||||||
|
property author_verified : Bool
|
||||||
property ucid : String
|
property ucid : String
|
||||||
property published : Time
|
property published : Time
|
||||||
property views : Int64
|
property views : Int64
|
||||||
|
Loading…
Reference in New Issue
Block a user