From 3dcf1e86263d55f75bdf6d0f6725a29aef51719b Mon Sep 17 00:00:00 2001 From: Kaaninchen <124433727+kaaninchen@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:27:47 +0200 Subject: [PATCH] transitous rewrite: only show next_stop if its actually stop and not the beginn of the route --- src/dc/handlers.py | 4 +--- src/utils.py | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/dc/handlers.py b/src/dc/handlers.py index 8bc41c3..0b5450e 100644 --- a/src/dc/handlers.py +++ b/src/dc/handlers.py @@ -127,14 +127,12 @@ async def _update_next_loop(bot: discord.Bot, voice_channel: discord.VoiceChanne if trip is None: return - ''' now = datetime.now(LOCAL_TZ) departure_dt = trip["departure_dt"] if departure_dt > now: - wait_seconds = (departure_dt - now).total_seconds() + wait_seconds = (departure_dt - now).total_seconds() + 10 await asyncio.sleep(wait_seconds) - ''' while True: next_stop = get_next_station(trip["stops"], trip["from"]) diff --git a/src/utils.py b/src/utils.py index b317dc2..9588df2 100644 --- a/src/utils.py +++ b/src/utils.py @@ -154,11 +154,6 @@ def get_next_station(stops: dict, train_from: str) -> dict | None: for name, info in stops.items(): arrival_dt = info["arrival"] if arrival_dt >= now: - return { - "name": name, - "arrival": arrival_dt - } - ''' if name == train_from: return None else: @@ -166,7 +161,7 @@ def get_next_station(stops: dict, train_from: str) -> dict | None: "name": name, "arrival": arrival_dt } -''' + return None def format_via_list(stops: dict, via_and: str) -> str: