summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-12-28 13:36:23 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-12-28 13:36:23 +0000
commitfc9e910a1f538466d216bef9e0355a5865582512 (patch)
treec65b813ac84306be66bc3d1aa0b11c43b766dd78 /scripts
parentAlways save availability as int (diff)
downloadtoy-fc9e910a1f538466d216bef9e0355a5865582512.zip
Only load images for directories with tags file
Diffstat (limited to 'scripts')
-rw-r--r--scripts/toy.groovy6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index ce64ba6..e038a08 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -49,10 +49,12 @@ final IMAGEDATA = {
domme: d.getName(),
sets: d.listFiles()
.findAll { s -> s.isDirectory(); }
+ .collect { s -> [ sub: s, f: new File(s.getPath() + "/tags")] }
+ .findAll { s -> s.f.canRead() }
.collect { s ->
[
- set: s.getName(),
- images: new File(s.getPath() + "/tags")
+ set: s.sub.getName(),
+ images: s.f
.readLines()
.collect { l ->
def fields = l.split(":");