From dacf0879a5dad95babe630f4bdeb2b20b96e0a70 Mon Sep 17 00:00:00 2001 From: mark <> Date: Mon, 15 Dec 2025 09:56:46 +0100 Subject: [PATCH] feat: fix line numbers --- src/api.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/api.rs b/src/api.rs index 970c2ee..3d8b723 100644 --- a/src/api.rs +++ b/src/api.rs @@ -199,14 +199,12 @@ pub async fn bahnhof_get_departures() -> Result { o.push_str("
"); } o.push_str(""); - let line_name = if let Some(p) = &line_name.product { - if let Some(nr) = &line_name.line_number { - format!("{p} {nr}") - } else { - format!("{p}") - } + let line_name = if let Some(txt) = &line_name.text_medium { + txt.as_str() + } else if let Some(txt) = &line_name.line_number { + txt.as_str() } else { - "[?]".to_owned() + "[?]" }; html_escape::encode_safe_to_string(&line_name, &mut o); o.push_str(""); @@ -423,8 +421,12 @@ struct BahnhofResDeparture { pub struct BahnhofResDepartureDestination { #[serde(rename = "linienNummer")] pub line_number: Option, - #[serde(rename = "kurzText")] - pub product: Option, + // #[serde(rename = "kurzText")] + // pub text_short: Option, + #[serde(rename = "mittelText")] + pub text_medium: Option, + // #[serde(rename = "langText")] + // pub text_long: Option, } #[derive(Deserialize)] pub struct BahnhofResDepartureMessage {