From 09b3c99bfe52c44397a813d8373cc80fa7d64bfd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 16:46:50 +0000 Subject: [PATCH] Correct initial gather paths --- meta/folder.groovy | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 96a37f8..e6bd3c5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -923,18 +923,8 @@ class MetaInfo extends GISJsonSerialised { def openchildmeta(String gatheredpath, String gatheredmetapath, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) - def String nextgatheredpath - if (gatheredpath == '') { - nextgatheredpath = "${relatedmetainfo.offsetpath}" - } else { - nextgatheredpath = "${gatheredpath}/${relatedmetainfo.offsetpath}" - } - def String nextgatheredmetapath - if (gatheredmetapath == '') { - nextgatheredmetapath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" - } else { - nextgatheredmetapath = "${gatheredmetapath}/${relatedmetainfo.offsetpath}" - } + def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${gatheredmetapath}/${relatedmetainfo.offsetpath}" def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { @@ -972,11 +962,13 @@ class MetaInfo extends GISJsonSerialised { for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (gatheredmetapath == '' ? gatheredmetapath : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, - "${gatheredpath}/${relatedmetainfo.offsetpath}", - "${gatheredmetapath}/${relatedmetainfo.offsetpath}", + nextgatheredpath, + nextgatheredmetapath, limiteddepth, maxdepth - 1) } else { @@ -1032,9 +1024,7 @@ class MetaInfo extends GISJsonSerialised { def allrelatedmeta(String metapath = '') { ArrayList metacollection = new ArrayList() - - def startmetapath = (metapath == '' ? METAFOLDERNAME : "${metapath}/${METAFOLDERNAME}") - return walkrelated(metacollection, '', 0, '', startmetapath) + return walkrelated(metacollection, '', 0, '', metapath) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') {