diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-09-17 19:21:13 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-09-17 19:21:13 -0500 |
| commit | 64cc0362fb43ff6168aff8be2759c641b49b779c (patch) | |
| tree | 6c034c59f8b3ef4dd1de3250666c20271bdcb602 /src | |
| parent | 35bee987f60a12d3c246789e79c6012756577034 (diff) | |
| download | invidious-64cc0362fb43ff6168aff8be2759c641b49b779c.tar.gz invidious-64cc0362fb43ff6168aff8be2759c641b49b779c.tar.bz2 invidious-64cc0362fb43ff6168aff8be2759c641b49b779c.zip | |
Add fix for playlists with no views
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/playlists.cr | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 4b00e429..edfe6728 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -138,7 +138,12 @@ def fetch_playlist(plid) ucid = anchor.xpath_node(%q(.//li[1]/a)).not_nil!["href"].split("/")[2] video_count = anchor.xpath_node(%q(.//li[2])).not_nil!.content.delete("videos, ").to_i - views = anchor.xpath_node(%q(.//li[3])).not_nil!.content.delete("views, ").to_i64 + views = anchor.xpath_node(%q(.//li[3])).not_nil!.content.delete("No views, ") + if views.empty? + views = 0_i64 + else + views = views.to_i64 + end updated = anchor.xpath_node(%q(.//li[4])).not_nil!.content.lchop("Last updated on ").lchop("Updated ") updated = decode_date(updated) |
