mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
ignore 'Sitzenbleiber'
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@38 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
846547ff74
commit
58b01862fc
1 changed files with 51 additions and 46 deletions
|
@ -342,6 +342,7 @@ public class MvvProvider implements NetworkProvider
|
|||
+ "an\\s+(.*?)\\s*<a" //
|
||||
+ ").*?", Pattern.DOTALL);
|
||||
private static final Pattern P_CONNECTION_DETAILS_ERRORS = Pattern.compile("(session has expired)", Pattern.CASE_INSENSITIVE);
|
||||
private static final String SITZENBLEIBER = "Sitzenbleiber";
|
||||
|
||||
public GetConnectionDetailsResult getConnectionDetails(final String uri) throws IOException
|
||||
{
|
||||
|
@ -369,12 +370,15 @@ public class MvvProvider implements NetworkProvider
|
|||
while (mDetCoarse.find())
|
||||
{
|
||||
final String set = mDetCoarse.group(2) + mDetCoarse.group(3) + mDetCoarse.group(4);
|
||||
if (!set.contains(SITZENBLEIBER))
|
||||
{
|
||||
final Matcher mDetFine = P_CONNECTION_DETAILS_FINE.matcher(set);
|
||||
if (mDetFine.matches())
|
||||
{
|
||||
if (mDetFine.group(8) == null)
|
||||
{
|
||||
final Date departureTime = upTime(lastTime, ParserUtils.joinDateTime(currentDate, ParserUtils.parseTime(mDetFine.group(1))));
|
||||
final Date departureTime = upTime(lastTime, ParserUtils.joinDateTime(currentDate, ParserUtils
|
||||
.parseTime(mDetFine.group(1))));
|
||||
|
||||
final String departure = ParserUtils.resolveEntities(mDetFine.group(2));
|
||||
if (departure != null && firstDeparture == null)
|
||||
|
@ -424,6 +428,7 @@ public class MvvProvider implements NetworkProvider
|
|||
lastArrival = arrival;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot parse '" + set + "' on " + uri);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue