You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
fix skip
This commit is contained in:
@@ -83,13 +83,13 @@ class Module(ActiveModifier):
|
|||||||
if last_track_duration and last_track_duration > 5*60:
|
if last_track_duration and last_track_duration > 5*60:
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
future = datetime.datetime.fromtimestamp(now.timestamp() + last_track_duration)
|
future = datetime.datetime.fromtimestamp(now.timestamp() + last_track_duration)
|
||||||
if now.hour < self.morning_start and future.hour > self.morning_start:
|
if now.hour < self.morning_start and future.hour >= self.morning_start:
|
||||||
logger.warning("Skipping track as it bleeds into the morning")
|
logger.warning("Skipping track as it bleeds into the morning")
|
||||||
return (None, None), None
|
return (None, None), None
|
||||||
elif now.hour < self.day_end and future.hour > self.day_end:
|
elif now.hour < self.day_end and future.hour >= self.day_end:
|
||||||
logger.warning("Skipping track as it bleeds into the night")
|
logger.warning("Skipping track as it bleeds into the night")
|
||||||
return (None, None), None
|
return (None, None), None
|
||||||
elif future.day > now.day: # late night goes mid day, as it starts at midnight
|
elif future.day != now.day: # late night goes mid day, as it starts at midnight
|
||||||
logger.warning("Skipping track as it the next day")
|
logger.warning("Skipping track as it the next day")
|
||||||
return (None, None), None
|
return (None, None), None
|
||||||
logger.info("Track ends at", repr(future))
|
logger.info("Track ends at", repr(future))
|
||||||
|
|||||||
Reference in New Issue
Block a user