Rebuild index only if there's new files

This commit is contained in:
Reinhard Pointner 2019-05-09 03:16:10 +07:00
parent f58cffda34
commit ff92d0cf33
1 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,8 @@ void createIndexFile(db) {
void build(ids, section, db, query) {
def files = []
ids.each{ id ->
def original = getOriginalPath(section, id)
def thumb = getThumbnailPath(section, id)
@ -90,11 +92,15 @@ void build(ids, section, db, query) {
if (original.length() > 0 && !thumb.exists()) {
createThumbnail(original, thumb)
files << thumb
ls thumb
}
}
createIndexFile(section)
if (files) {
createIndexFile(section)
}
}