1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 07:48:52 -05:00

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

View File

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