ignore 0 byte files

This commit is contained in:
j 2010-12-28 20:50:32 +05:30
parent d8fc7c10db
commit d4409a0411

View file

@ -125,12 +125,13 @@ class Client(object):
break break
if update: if update:
info = utils.avinfo(path) info = utils.avinfo(path)
oshash = info['oshash'] if info['size'] > 0:
deleted = -1 oshash = info['oshash']
t = (path, oshash, stat.st_atime, stat.st_ctime, stat.st_mtime, deleted = -1
stat.st_size, json.dumps(info), created, modified, deleted) t = (path, oshash, stat.st_atime, stat.st_ctime, stat.st_mtime,
c.execute(u'INSERT OR REPLACE INTO file values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', t) stat.st_size, json.dumps(info), created, modified, deleted)
conn.commit() c.execute(u'INSERT OR REPLACE INTO file values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', t)
conn.commit()
def scan(self): def scan(self):
print "check for new files" print "check for new files"