0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00
This commit is contained in:
Kuba
2025-10-18 19:55:46 +02:00
parent 40b299f2de
commit b5471d0df6

View File

@@ -58,10 +58,13 @@ class Module(ActiveModifier):
timestamp = now.timestamp() + last_track_duration
future = datetime.datetime.fromtimestamp(timestamp)
if now.hour < MORNING_START and future.hour > MORNING_START:
logger.warning("Skipping track as it bleeds into the morning")
return None, None
elif now.hour < DAY_END and future.hour > DAY_END:
logger.warning("Skipping track as it bleeds into the night")
return None, None
elif future.day > now.day: # late night goes mid day, as it starts at midnight
logger.warning("Skipping track as it the next day")
return None, None
return self.last_track, False