mirror of https://github.com/iv-org/invidious.git
Add fix for scheduled livestreams in search results
This commit is contained in:
parent
2c4a3b19e2
commit
4b962dddd3
|
@ -57,8 +57,13 @@ def search(query, page = 1, search_params = build_search_params(content_type: "v
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
view_count = metadata[0].content.lchop("Streamed ").split(" ")[0].delete(",").to_i64
|
if metadata[0].content.starts_with? "Starts"
|
||||||
published = Time.now
|
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
|
else
|
||||||
# Skip movies
|
# Skip movies
|
||||||
if metadata[0].content.includes? "·"
|
if metadata[0].content.includes? "·"
|
||||||
|
|
Loading…
Reference in New Issue