nicer label for SWISS

This commit is contained in:
ligi 2014-08-24 13:48:12 +02:00
parent 81521a7947
commit e749c8a281

View file

@ -14,6 +14,23 @@ public class ApplePassbookQuirkCorrector {
careForUSAirways(pass);
careForVirginAustralia(pass);
careForCathayPacific(pass);
careForSWISS(pass);
}
private static void careForSWISS(PassImpl pass) {
if (!pass.getOrganisation().isPresent() || !pass.getOrganisation().get().equals("SWISS")) {
return;
}
Tracker.get().trackEvent("quirk_fix", "description_replace", "SWISS", 0L);
final Optional<PassField> optionalDepart = pass.getPrimaryFields().getPassFieldForKey("depart");
final Optional<PassField> optionalArrive = pass.getPrimaryFields().getPassFieldForKey("destination");
if (optionalDepart.isPresent() && optionalArrive.isPresent()) {
Tracker.get().trackEvent("quirk_fix", "description_replace", "SWISS", 1L);
pass.setDescription(optionalDepart.get().value + " -> " + optionalArrive.get().value);
}
}