mirror of
https://github.com/iv-org/invidious.git
synced 2026-08-16 21:10:53 -05:00
Continue scan past empty browseId in parse_related_video (#5722)
get_browse_id returns "" (not nil) when no browseId is present, so the previous stopped on the first empty run and never reached a later creator that did carry a channel id. Now skip empty ids and keep scanning until a non-empty browseId is found (fixes the Greptile P1: first byline run empty, later run has id).
This commit is contained in:
parent
bfb7f6a309
commit
cc5beb5630
@ -32,11 +32,16 @@ module Invidious::Videos::Parser
|
||||
ucid = byline.try do |b|
|
||||
runs = b.dig?("runs")
|
||||
next nil unless runs
|
||||
found_id = nil
|
||||
runs.as_a.each do |run|
|
||||
if id = HelperExtractors.get_browse_id(run)
|
||||
break id
|
||||
end
|
||||
id = HelperExtractors.get_browse_id(run)
|
||||
# get_browse_id returns "" (not nil) when no browseId is present, so an
|
||||
# empty first run must not stop the scan. Only keep a non-empty id.
|
||||
next if id.empty?
|
||||
found_id = id
|
||||
break
|
||||
end
|
||||
found_id
|
||||
end
|
||||
|
||||
author_verified = has_verified_badge?(related["ownerBadges"]?).to_s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user