mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	Add live now indicator to playlists
This commit is contained in:
		@@ -8,6 +8,7 @@ class PlaylistVideo
 | 
			
		||||
    published:      Time,
 | 
			
		||||
    playlists:      Array(String),
 | 
			
		||||
    index:          Int32,
 | 
			
		||||
    live_now:       Bool,
 | 
			
		||||
  })
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -101,8 +102,10 @@ def extract_playlist(plid, nodeset, index)
 | 
			
		||||
    anchor = video.xpath_node(%q(.//td[@class="pl-video-time"]/div/div[1]))
 | 
			
		||||
    if anchor && !anchor.content.empty?
 | 
			
		||||
      length_seconds = decode_length_seconds(anchor.content)
 | 
			
		||||
      live_now = false
 | 
			
		||||
    else
 | 
			
		||||
      length_seconds = 0
 | 
			
		||||
      live_now = true
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    videos << PlaylistVideo.new(
 | 
			
		||||
@@ -114,6 +117,7 @@ def extract_playlist(plid, nodeset, index)
 | 
			
		||||
      published: Time.now,
 | 
			
		||||
      playlists: [plid],
 | 
			
		||||
      index: index + offset,
 | 
			
		||||
      live_now: live_now
 | 
			
		||||
    )
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user