--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2011/05/02 08:08:56 1405 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2011/05/02 09:34:53 1406 @@ -81,6 +81,13 @@ return id; } + + String correctStationName(String name) { + if (name.equals("København")) + name = "København H"; //correct inconsistency in naming + + return name; + } TimetableBean lookupTimetableAzureSite(String trainID, String type) throws Exception { TimetableBean timetableBean = new TimetableBean(); @@ -120,9 +127,7 @@ TimetableEntry entry = new TimetableEntry(); - String station = fields.get(0).text() ; - if (station.equals("København")) - station = "København H"; //correct inconsistency in naming + String station = correctStationName( fields.get(0).text() ); entry.setStation( station ); entry.setArrival( fields.get(1).text() ); @@ -201,8 +206,8 @@ TimetableEntry entry = new TimetableEntry(); String station = DepartureFetcher.cleanText( parts[0] ) ; - if (station.equals("København")) - station = "København H"; //correct inconsistency in naming + station = correctStationName(station); + String arrival = DepartureFetcher.cleanText( parts[1] ); String departure = DepartureFetcher.cleanText( "" ); @@ -262,8 +267,8 @@ TimetableEntry entry = new TimetableEntry(); String station = DepartureFetcher.cleanText( fields.get(0).text() ) ; - if (station.equals("København")) - station = "København H"; //correct inconsistency in naming + station = correctStationName(station); + String arrival = DepartureFetcher.cleanText( fields.get(1).text() ); String departure = DepartureFetcher.cleanText( fields.get(2).text() );