diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-03-24 09:10:14 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-03-24 09:10:14 -0500 |
| commit | a3b767bb1337ab2ceb409e0ad14c9eca7570dbe9 (patch) | |
| tree | 1385e8b8d3890a8c87af6e280fd0a8173d60230a | |
| parent | 847ee61bf4b961062c644956a286c856d3ecaad4 (diff) | |
| download | invidious-a3b767bb1337ab2ceb409e0ad14c9eca7570dbe9.tar.gz invidious-a3b767bb1337ab2ceb409e0ad14c9eca7570dbe9.tar.bz2 invidious-a3b767bb1337ab2ceb409e0ad14c9eca7570dbe9.zip | |
Add live now indicator to playlists
| -rw-r--r-- | src/invidious/playlists.cr | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 9f844ce6..88308686 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -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 |
