CC-4565: Pypopush: Error happens when trying to insert a song right behind a Webstream as well as that Webstream is just finished
-make sure we don't return a negative when calculating interval seconds
This commit is contained in:
parent
9d23e61acc
commit
a929561088
|
@ -399,7 +399,15 @@ class PypoPush(Thread):
|
|||
|
||||
|
||||
def date_interval_to_seconds(self, interval):
|
||||
return (interval.microseconds + (interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
||||
"""
|
||||
Convert timedelta object into int representing the number of seconds. If
|
||||
number of seconds is less than 0, then return 0.
|
||||
"""
|
||||
seconds = (interval.microseconds + \
|
||||
(interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
||||
if seconds < 0: seconds = 0
|
||||
|
||||
return seconds
|
||||
|
||||
def push_to_liquidsoap(self, event_chain):
|
||||
|
||||
|
|
Loading…
Reference in New Issue