diff options
Diffstat (limited to 'save-html.c')
-rw-r--r-- | save-html.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/save-html.c b/save-html.c index d67931d8f..d15ac962f 100644 --- a/save-html.c +++ b/save-html.c @@ -140,10 +140,12 @@ static void put_cylinder_HTML(struct membuffer *b, struct dive *dive) } if (cylinder->gasmix.o2.permille) { - put_format(b, "\"O2\":\"%u.%u%%\"", FRACTION(cylinder->gasmix.o2.permille, 10)); + put_format(b, "\"O2\":\"%u.%u%%\",", FRACTION(cylinder->gasmix.o2.permille, 10)); + put_format(b, "\"He\":\"%u.%u%%\"", FRACTION(cylinder->gasmix.he.permille, 10)); } else { write_attribute(b, "O2", "Air", ""); } + put_string(b, "}"); } @@ -172,8 +174,11 @@ void put_HTML_samples(struct membuffer *b, struct dive *dive) void put_HTML_coordinates(struct membuffer *b, struct dive *dive) { - degrees_t latitude = dive->latitude; - degrees_t longitude = dive->longitude; + struct dive_site *ds = get_dive_site_for_dive(dive); + if (!ds) + return; + degrees_t latitude = ds->latitude; + degrees_t longitude = ds->longitude; //don't put coordinates if in (0,0) if (!latitude.udeg && !longitude.udeg) @@ -304,7 +309,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d put_format(b, "\"subsurface_number\":%d,", dive->number); put_HTML_date(b, dive, "\"date\":\"", "\","); put_HTML_time(b, dive, "\"time\":\"", "\","); - write_attribute(b, "location", dive->location, ", "); + write_attribute(b, "location", get_dive_location(dive), ", "); put_HTML_coordinates(b, dive); put_format(b, "\"rating\":%d,", dive->rating); put_format(b, "\"visibility\":%d,", dive->visibility); @@ -324,7 +329,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d put_HTML_samples(b, dive); put_HTML_bookmarks(b, dive); write_dive_status(b, dive); - if (photos_dir) + if (photos_dir && strcmp(photos_dir, "")) save_photos(b, photos_dir, dive); write_divecomputers(b, dive); } |