mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-04 06:31:57 +00:00 
			
		
		
		
	Support ProblematicTimelineItem in trending feed
This commit is contained in:
		@@ -299,8 +299,11 @@ end
 | 
				
			|||||||
# the rest of the (hopefully) successfully parsed item on a page.
 | 
					# the rest of the (hopefully) successfully parsed item on a page.
 | 
				
			||||||
struct ProblematicTimelineItem
 | 
					struct ProblematicTimelineItem
 | 
				
			||||||
  property parse_exception : Exception
 | 
					  property parse_exception : Exception
 | 
				
			||||||
 | 
					  property id : String
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(@parse_exception); end
 | 
					  def initialize(@parse_exception)
 | 
				
			||||||
 | 
					    @id = Random.new.hex(8)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def to_json(locale : String?, json : JSON::Builder)
 | 
					  def to_json(locale : String?, json : JSON::Builder)
 | 
				
			||||||
    json.object do
 | 
					    json.object do
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,12 +31,12 @@ def fetch_trending(trending_type, region, locale)
 | 
				
			|||||||
      # See: https://github.com/iv-org/invidious/issues/2989
 | 
					      # See: https://github.com/iv-org/invidious/issues/2989
 | 
				
			||||||
      next if (itm.contents.size < 24 && deduplicate)
 | 
					      next if (itm.contents.size < 24 && deduplicate)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      extracted.concat extract_category(itm)
 | 
					      extracted.concat itm.contents.select(SearchItem)
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      extracted << itm
 | 
					      extracted << itm
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Deduplicate items before returning results
 | 
					  # Deduplicate items before returning results
 | 
				
			||||||
  return extracted.select(SearchVideo).uniq!(&.id), plid
 | 
					  return extracted.select(SearchVideo | ProblematicTimelineItem).uniq!(&.id), plid
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user