diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-08-24 10:37:18 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-25 10:43:48 -0700 |
commit | e03b553e80a00b07757f51f7866bc666b807dce8 (patch) | |
tree | 5c3ec6d5cc5bdc556f01d4a524a3df44113fbbb4 /uemis-downloader.c | |
parent | 6eed3155e6a84f1b27b5340b45d6deb801fee42d (diff) | |
download | subsurface-e03b553e80a00b07757f51f7866bc666b807dce8.tar.gz |
Make created dive site uuid deterministic
Having random uuids seemed like a good idea, but there are several
situations where they really cause problems. One is merging dive file
imports from V2 logfiles. Another is testing such imports.
Instead of making the uuid random we now hash the name and add the
timestamp of the first dive associated with this dive site to the hash
(first in this context is "first encountered" with no guarantee that it is
the chronologically first). This way V2 imports create deterministic uuids
but uuid conflicts are still extremely unlikely, even if the user has
multiple dive sites with the same name.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index 17f7129d1..baf948415 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -803,7 +803,7 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char * if (for_dive) *for_dive = atoi(val); } else if (!log && dive && !strcmp(tag, "divespot_id")) { - dive->dive_site_uuid = create_dive_site("from Uemis"); + dive->dive_site_uuid = create_dive_site("from Uemis", dive->when); track_divespot(val, dive->dc.diveid, dive->dive_site_uuid); } else if (dive) { parse_tag(dive, tag, val); |