From 75c9e412287ace0801d752ce731824243d7c8b53 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Sun, 14 Sep 2025 18:12:53 +0200
Subject: feat: small changes

---
 src/routes/(app)/fahrplan/+page.svelte | 30 ++++++++++--------------------
 1 file changed, 10 insertions(+), 20 deletions(-)

(limited to 'src/routes/(app)/fahrplan/+page.svelte')

diff --git a/src/routes/(app)/fahrplan/+page.svelte b/src/routes/(app)/fahrplan/+page.svelte
index 336c7bb..7584530 100644
--- a/src/routes/(app)/fahrplan/+page.svelte
+++ b/src/routes/(app)/fahrplan/+page.svelte
@@ -10,24 +10,11 @@
   import { page } from '$app/state';
   import { m } from '$lib/paraglide/messages';
   import motis from '$lib/motis-api';
-  import { placeNameMap } from '$lib/aliases';
-
-  const normaliseGermanUmlauts = (n: string) => {
-    return n
-      .replace(/ü/gu, 'ue')
-      .replace(/Ü/gu, 'UE')
-      .replace(/ä/gu, 'ae')
-      .replace(/Ä/gu, 'AE')
-      .replace(/ö/gu, 'oe')
-      .replace(/ß/gu, 'ss');
-  };
-  const normalisePlaceName = (n: string) =>
-    placeNameMap.has(n.toLowerCase()) ? placeNameMap.get(n.toLowerCase())! : n;
-  const arePlacenamesEqual = (n1: string, n2: string) =>
-    normalisePlaceName(
-      normaliseGermanUmlauts(n1).toUpperCase()
-    ).toUpperCase() ===
-    normalisePlaceName(normaliseGermanUmlauts(n2)).toUpperCase();
+  import {
+    arePlacenamesEqual,
+    normalisePlaceName,
+    placeNameMap,
+  } from '$lib/aliases';
 
   let searchQuery = $state('');
   let searchSuggestionIdx = $state(0);
@@ -107,7 +94,10 @@
   let stopTimes = $state(null as null | StoptimesResponse);
   let hasQueriedResults = $state(false);
   let renderedObjectIdName = $derived(
-    normalisePlaceName(objectIdName || (stopTimes?.place?.name ?? ''))
+    normalisePlaceName(
+      objectIdName || (stopTimes?.place?.name ?? ''),
+      objectId ?? undefined
+    )
   );
 
   const search = async (query: string) => {
@@ -190,7 +180,7 @@
           progressKind = 'fetch';
           try {
             resultsLoopCancel = new AbortController();
-            const json = await motis.getStopTimes(
+            const json = await motis.getStationTimetable(
               objectId,
               resultsLoopCancel.signal,
               isArrivals
-- 
cgit v1.2.3

