mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-04 06:31:57 +00:00 
			
		
		
		
	Fix comment replies count
This commit is contained in:
		@@ -195,8 +195,14 @@ def fetch_youtube_comments(id, db, cursor, format, locale, thin_mode, region, so
 | 
				
			|||||||
              end
 | 
					              end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              if node_replies && !response["commentRepliesContinuation"]?
 | 
					              if node_replies && !response["commentRepliesContinuation"]?
 | 
				
			||||||
                reply_count = (node_replies["moreText"]["simpleText"]? || node_replies["moreText"]["runs"]?.try &.[0]?.try &.["text"]?)
 | 
					                if node_replies["moreText"]?
 | 
				
			||||||
                  .try &.as_s.gsub(/\D/, "").to_i? || 1
 | 
					                  reply_count = (node_replies["moreText"]["simpleText"]? || node_replies["moreText"]["runs"]?.try &.[0]?.try &.["text"]?)
 | 
				
			||||||
 | 
					                    .try &.as_s.gsub(/\D/, "").to_i? || 1
 | 
				
			||||||
 | 
					                elsif node_replies["viewReplies"]?
 | 
				
			||||||
 | 
					                  reply_count = node_replies["viewReplies"]["buttonRenderer"]["text"]?.try &.["runs"][1]?.try &.["text"]?.try &.as_s.to_i? || 1
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                  reply_count = 1
 | 
				
			||||||
 | 
					                end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s
 | 
					                continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s
 | 
				
			||||||
                continuation ||= ""
 | 
					                continuation ||= ""
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user