diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-08-07 08:19:20 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-08-07 08:19:20 -0500 |
| commit | 4b962dddd30fac0b4a5b058b5d18c014239a224d (patch) | |
| tree | 1c18722dba6fde975904fdea2d93fe5bcc133c62 | |
| parent | 2c4a3b19e259b62dce49dfe6492131c3139d6762 (diff) | |
| download | invidious-4b962dddd30fac0b4a5b058b5d18c014239a224d.tar.gz invidious-4b962dddd30fac0b4a5b058b5d18c014239a224d.tar.bz2 invidious-4b962dddd30fac0b4a5b058b5d18c014239a224d.zip | |
Add fix for scheduled livestreams in search results
| -rw-r--r-- | src/invidious/search.cr | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/invidious/search.cr b/src/invidious/search.cr index 3d7c4ba4..e66d76fd 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -57,8 +57,13 @@ def search(query, page = 1, search_params = build_search_params(content_type: "v next end - view_count = metadata[0].content.lchop("Streamed ").split(" ")[0].delete(",").to_i64 - published = Time.now + if metadata[0].content.starts_with? "Starts" + view_count = 0_i64 + published = Time.epoch(metadata[0].xpath_node(%q(.//span)).not_nil!["data-timestamp"].to_i64) + else + view_count = metadata[0].content.lchop("Streamed ").split(" ")[0].delete(",").to_i64 + published = Time.now + end else # Skip movies if metadata[0].content.includes? "ยท" |
