feat: fix line numbers

This commit is contained in:
mark
2025-12-15 09:56:46 +01:00
parent 87836948ba
commit dacf0879a5

View File

@@ -199,14 +199,12 @@ pub async fn bahnhof_get_departures() -> Result<String, String> {
o.push_str("<div>");
}
o.push_str("<b>");
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("</b>");
@@ -423,8 +421,12 @@ struct BahnhofResDeparture {
pub struct BahnhofResDepartureDestination {
#[serde(rename = "linienNummer")]
pub line_number: Option<String>,
#[serde(rename = "kurzText")]
pub product: Option<String>,
// #[serde(rename = "kurzText")]
// pub text_short: Option<String>,
#[serde(rename = "mittelText")]
pub text_medium: Option<String>,
// #[serde(rename = "langText")]
// pub text_long: Option<String>,
}
#[derive(Deserialize)]
pub struct BahnhofResDepartureMessage {