Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Fijxu
2024-08-24 15:56:36 -04:00
23 changed files with 635 additions and 252 deletions

View File

@@ -90,7 +90,7 @@ struct SearchVideo
json.field "lengthSeconds", self.length_seconds
json.field "liveNow", self.live_now
json.field "premium", self.premium
json.field "isUpcoming", self.is_upcoming
json.field "isUpcoming", self.upcoming?
if self.premiere_timestamp
json.field "premiereTimestamp", self.premiere_timestamp.try &.to_unix
@@ -109,7 +109,7 @@ struct SearchVideo
to_json(nil, json)
end
def is_upcoming
def upcoming?
premiere_timestamp ? true : false
end
end

View File

@@ -10,10 +10,8 @@ class Invidious::DecryptFunction
end
def check_update
now = Time.utc
# If we have updated in the last 5 minutes, do nothing
return if (now - @last_update) > 5.minutes
return if (Time.utc - @last_update) < 5.minutes
# Get the amount of time elapsed since when the player was updated, in the
# event where multiple invidious processes are run in parallel.