From fc9e910a1f538466d216bef9e0355a5865582512 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 28 Dec 2018 13:36:23 +0000 Subject: Only load images for directories with tags file --- scripts/toy.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/toy.groovy') 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(":"); -- cgit v1.2.3