Commit graph

9 commits

Author SHA1 Message Date
Miika Turkia
9607ff6c93 Import picture URLs from divelogs.de
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 21:03:27 -07:00
Miika Turkia
6d65e45787 Support for importing additional tanks
This patch adds support for importing additional cylinders from
divelogs.de. This also adds support for He on the import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 14:59:51 -04:00
Miika Turkia
e07072f10a Do not add unnecessary / at end of location on divelogs import
The check if both location and site exist was flawed causing an extra
slash on location name when the SITE was empty. Thus resulting in
multiple location candidates when exporting to divelogs.de and
re-importing to Subsurface.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-17 06:50:50 -07:00
Miika Turkia
38d224a335 Only print separator when really needed on import
The separator was printed if SITE had data, even if LOCATION was empty.
Now print the separator only if both of these contain data.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-16 15:16:41 -07:00
Miika Turkia
757791335f Support divelogs.de exports that include Cyrillic characters
divelogs.de sends us XML files that explicitly state that they are in
ISO-8859-1 encoding (which is true). These files contain the HTML encoded
Cyrillic characters. Once we decode those characters the resulting file is
actually UTF-8 encoded (which is a superset of ISO-8859-1). That seriously
confuses libxml when it tries to parse things.

So instead recognize divelogs.de files and skip the encoding declaration
for them before decoding the HTML encoded non-ISO-8859-1 characters.

This does show, however, that divelogs.de incorrectly truncates the
encoded strings (at least in some sample data that I created the parsing
throws errors because of that).

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Based-on-code-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-15 16:29:37 -07:00
Miika Turkia
4297d931a3 Identify converted files as imported
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-08 10:17:33 -08:00
Miika Turkia
a9cc7f9b10 Fix import when locale set to decimal comma
This should take care of locale caused problems when the input uses decimal
point but locale uses decimal comma. Also the sample I have of Suunto DM3
format weight is represented with comma instead of dot so converting that as
well.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07 10:27:20 -08:00
Miika Turkia
ff1c33401b Divelogs.de import empty value fix
This checks that weight and dive durantion are defined before importing.
(Empty value concatenated with unit gives an error on import.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 20:19:59 -08:00
Miika Turkia
9b4c251ebe Import divelogs.de
This XSLT converts divelogs.de logs into Subsurface format. Data that is
discarded: weather, water visibility, boat name.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 10:57:24 -08:00