Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
c94f9393
Commit
c94f9393
authored
Oct 04, 2022
by
Volker Krause
Browse files
Support German language variants of Thalys PDF tickets as well
parent
5adc6297
Pipeline
#241670
passed with stage
in 4 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/thalys.js
View file @
c94f9393
...
...
@@ -60,15 +60,15 @@ function parsePdfTicket(pdf, node, triggerNode)
const
page
=
pdf
.
pages
[
triggerNode
.
location
];
var
res
=
triggerNode
.
result
[
0
];
const
dep
=
page
.
textInRect
(
0.0
,
0.15
,
0.35
,
0.3
).
match
(
/
([\s\S]
+
)\n
DÉPART À
\n(\d\d
:
\d\d)
/
);
const
dep
=
page
.
textInRect
(
0.0
,
0.15
,
0.35
,
0.3
).
match
(
/
([\s\S]
+
)\n
(?:
DÉPART À
|ABFAHRT
)
\n(\d\d
:
\d\d)
/
);
res
.
reservationFor
.
departureStation
.
name
=
dep
[
1
];
res
.
reservationFor
.
departureTime
=
res
.
reservationFor
.
departureDay
.
substr
(
0
,
11
)
+
dep
[
2
];
const
arr
=
page
.
textInRect
(
0.35
,
0.15
,
0.65
,
0.3
).
match
(
/
([\s\S]
+
)\n
ARRIVÉE À
\n(\d\d
:
\d\d)
/
);
const
arr
=
page
.
textInRect
(
0.35
,
0.15
,
0.65
,
0.3
).
match
(
/
([\s\S]
+
)\n
(?:
ARRIVÉE À
|ANKUNFT
)
\n(\d\d
:
\d\d)
/
);
res
.
reservationFor
.
arrivalStation
.
name
=
arr
[
1
];
res
.
reservationFor
.
arrivalTime
=
res
.
reservationFor
.
departureDay
.
substr
(
0
,
11
)
+
arr
[
2
];
const
passenger
=
page
.
text
.
match
(
/PASSAGER
\n(
.*
)\n
/
);
const
passenger
=
page
.
text
.
match
(
/
(?:
PASSAGER
|FAHRGAST
)
\n(
.*
)\n
/
);
res
.
underName
.
name
=
passenger
[
1
];
return
res
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment