mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-09-24 01:52:29 +02:00
restructure epg
This commit is contained in:
@@ -398,11 +398,16 @@ class MagentaEUEpgManager:
|
||||
if end_time:
|
||||
local_end = self._ensure_tz(end_time).astimezone(_VIENNA_TZ)
|
||||
if local_end.date() == local_date.date():
|
||||
end_hour = min(((local_end.hour // 3) + 1) * 3, 24)
|
||||
logger.debug(
|
||||
f"end_time UTC={end_time} → Vienna local={local_end}, "
|
||||
f"hour_offset={end_hour}"
|
||||
)
|
||||
# Calculate which 3-hour block the end time falls into
|
||||
end_block = local_end.hour // 3
|
||||
# If end time is exactly at a block boundary (e.g., 3:00, 6:00),
|
||||
# we don't need the block starting at that hour
|
||||
if local_end.hour % 3 == 0:
|
||||
# End time is at the start of a block → we don't need that block
|
||||
end_hour = end_block * 3
|
||||
else:
|
||||
# End time is inside a block → we need that block
|
||||
end_hour = (end_block + 1) * 3
|
||||
|
||||
logger.debug(
|
||||
f"[MagentaEUEpgManager/{self._country}] "
|
||||
|
||||
Reference in New Issue
Block a user