Skip to content

Commit 7b27585

Browse files
committed
Support ProblematicTimelineItem in trending feed
1 parent f7810ba commit 7b27585

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/invidious/helpers/serialized_yt_data.cr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,11 @@ end
299299
# the rest of the (hopefully) successfully parsed item on a page.
300300
struct ProblematicTimelineItem
301301
property parse_exception : Exception
302+
property id : String
302303

303-
def initialize(@parse_exception); end
304+
def initialize(@parse_exception)
305+
@id = Random.new.hex(8)
306+
end
304307

305308
def to_json(locale : String?, json : JSON::Builder)
306309
json.object do

src/invidious/trending.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ def fetch_trending(trending_type, region, locale)
3131
# See: https://github.com/iv-org/invidious/issues/2989
3232
next if (itm.contents.size < 24 && deduplicate)
3333

34-
extracted.concat extract_category(itm)
34+
extracted.concat itm.contents.select(SearchItem)
3535
else
3636
extracted << itm
3737
end
3838
end
3939

4040
# Deduplicate items before returning results
41-
return extracted.select(SearchVideo).uniq!(&.id), plid
41+
return extracted.select(SearchVideo | ProblematicTimelineItem).uniq!(&.id), plid
4242
end

0 commit comments

Comments
 (0)