rename workaround for cathay pacific
This commit is contained in:
parent
26464d634f
commit
52a56ea1ba
1 changed files with 20 additions and 0 deletions
|
@ -13,8 +13,28 @@ public class ApplePassbookQuirkCorrector {
|
|||
careForAirCanada(pass);
|
||||
careForUSAirways(pass);
|
||||
careForVirginAustralia(pass);
|
||||
careForCathayPacific(pass);
|
||||
}
|
||||
|
||||
|
||||
private static void careForCathayPacific(PassImpl pass) {
|
||||
if (!pass.getOrganisation().isPresent() || !pass.getOrganisation().get().equals("Cathay Pacific")) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Tracker.get().trackEvent("quirk_fix", "description_replace", "cathay_pacific", 0L);
|
||||
|
||||
final Optional<PassField> optionalDepart = pass.getPrimaryFields().getPassFieldForKey("departure");
|
||||
final Optional<PassField> optionalArrive = pass.getPrimaryFields().getPassFieldForKey("arrival");
|
||||
|
||||
if (optionalDepart.isPresent() && optionalArrive.isPresent()) {
|
||||
Tracker.get().trackEvent("quirk_fix", "description_replace", "cathay_pacific", 1L);
|
||||
pass.setDescription(optionalDepart.get().label + " -> " + optionalArrive.get().label);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void careForVirginAustralia(PassImpl pass) {
|
||||
// also good identifier could be "passTypeIdentifier": "pass.com.virginaustralia.boardingpass
|
||||
if (!pass.getOrganisation().isPresent() || !pass.getOrganisation().get().equals("Virgin Australia")) {
|
||||
|
|
Loading…
Reference in a new issue