diff options
author | Guido Lerch <glerch@Guidos-MacBook-Air.local> | 2015-09-18 21:22:26 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-18 13:16:45 -0700 |
commit | 69c5e9adc23983aaffac54fa6d96174dd3719fc3 (patch) | |
tree | 61e35a4e6bd671719a3f98a84bcd5607098791c2 /uemis-downloader.c | |
parent | 90123c35ae2613c041526ac867f04ecd3b42c519 (diff) | |
download | subsurface-69c5e9adc23983aaffac54fa6d96174dd3719fc3.tar.gz |
Uemis downloader: reduce the amount of dive stops to be read
Changing the logic to check if a divespot was already read in
this round of reading in dives.
Signed-off-by: Guido Lerch <glerch@Guidos-MacBook-Air.local>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index 85a26d62a..b693421b9 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -1058,13 +1058,13 @@ static bool load_uemis_divespot(const char *mountpath, int divespot_id) static void get_uemis_divespot(const char *mountpath, int divespot_id, struct dive *dive) { - if (load_uemis_divespot(mountpath, divespot_id)) { - /* get the divesite based on the diveid, this should give us - * the newly created site - */ - struct dive_site *nds = get_dive_site_by_uuid(dive->dive_site_uuid); - struct dive_site *ods = NULL; - if (nds) { + struct dive_site *nds = get_dive_site_by_uuid(dive->dive_site_uuid); + if (strstr(nds->name,"from Uemis")) { + if (load_uemis_divespot(mountpath, divespot_id)) { + /* get the divesite based on the diveid, this should give us + * the newly created site + */ + struct dive_site *ods = NULL; /* with the divesite name we got from parse_dive, that is called on load_uemis_divespot * we search all existing divesites if we have one with the same name already. The function * returns the first found which is luckily not the newly created. @@ -1077,12 +1077,12 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di dive->dive_site_uuid = ods->uuid; } } + } else { + /* if we cant load the dive site details, delete the site we + * created in process_raw_buffer + */ + delete_dive_site(dive->dive_site_uuid); } - } else { - /* if we cant load the dive site details, delete the site we - * created in process_raw_buffer - */ - delete_dive_site(dive->dive_site_uuid); } } |