show type of boat
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-09-11 19:10:02 +02:00
parent 1da9412904
commit 14bfb695d9
4 changed files with 17 additions and 8 deletions

View File

@ -171,6 +171,16 @@ AND date('now') BETWEEN start_date AND end_date;",
.is_some()
}
pub(crate) fn cat(&self) -> String {
if self.external {
"Vereinsfremde Boote".to_string()
} else if self.default_shipmaster_only_steering {
format!("{}+", self.amount_seats - 1)
} else {
format!("{}x", self.amount_seats)
}
}
async fn boats_to_details(db: &SqlitePool, boats: Vec<Boat>) -> Vec<BoatWithDetails> {
let mut res = Vec::new();
for boat in boats {
@ -181,13 +191,7 @@ AND date('now') BETWEEN start_date AND end_date;",
if boat.is_locked(db).await {
damage = BoatDamage::Locked;
}
let cat = if boat.external {
"Vereinsfremde Boote".to_string()
} else if boat.default_shipmaster_only_steering {
format!("{}+", boat.amount_seats - 1)
} else {
format!("{}x", boat.amount_seats)
};
let cat = boat.cat();
res.push(BoatWithDetails {
damage,