mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-23 05:33:07 +05:30
Trending: Un-nest category if this is the only one (#4600)
Trending music was returning less than 24 videos which was getting filtered out. Since multiple categories only appears on the default trending page, we don't need to do that filtering for Music, Gaming or movies. Closes issue 4596
This commit is contained in:
commit
6f889dc695
@ -22,12 +22,14 @@ def fetch_trending(trending_type, region, locale)
|
|||||||
|
|
||||||
extracted = [] of SearchItem
|
extracted = [] of SearchItem
|
||||||
|
|
||||||
|
deduplicate = items.size > 1
|
||||||
|
|
||||||
items.each do |itm|
|
items.each do |itm|
|
||||||
if itm.is_a?(Category)
|
if itm.is_a?(Category)
|
||||||
# Ignore the smaller categories, as they generally contain a sponsored
|
# Ignore the smaller categories, as they generally contain a sponsored
|
||||||
# channel, which brings a lot of noise on the trending page.
|
# channel, which brings a lot of noise on the trending page.
|
||||||
# See: https://github.com/iv-org/invidious/issues/2989
|
# See: https://github.com/iv-org/invidious/issues/2989
|
||||||
next if itm.contents.size < 24
|
next if (itm.contents.size < 24 && deduplicate)
|
||||||
|
|
||||||
extracted.concat extract_category(itm)
|
extracted.concat extract_category(itm)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user