count up while scanning folder
This commit is contained in:
parent
5e606b21d8
commit
00c286b3d3
1 changed files with 8 additions and 1 deletions
|
@ -125,6 +125,7 @@ def run_import(options=None):
|
||||||
listitems = []
|
listitems = []
|
||||||
assert isinstance(prefix, unicode)
|
assert isinstance(prefix, unicode)
|
||||||
books = []
|
books = []
|
||||||
|
count = 0
|
||||||
for root, folders, files in os.walk(prefix):
|
for root, folders, files in os.walk(prefix):
|
||||||
for f in files:
|
for f in files:
|
||||||
#if f.startswith('._') or f == '.DS_Store':
|
#if f.startswith('._') or f == '.DS_Store':
|
||||||
|
@ -134,7 +135,13 @@ def run_import(options=None):
|
||||||
ext = f.split('.')[-1]
|
ext = f.split('.')[-1]
|
||||||
if ext in extensions:
|
if ext in extensions:
|
||||||
books.append(f)
|
books.append(f)
|
||||||
|
count += 1
|
||||||
|
if count % 1000 == 0:
|
||||||
|
state.activity = {
|
||||||
|
'activity': 'import',
|
||||||
|
'path': prefix,
|
||||||
|
'progress': [0, count],
|
||||||
|
}
|
||||||
state.activity = {
|
state.activity = {
|
||||||
'activity': 'import',
|
'activity': 'import',
|
||||||
'path': prefix,
|
'path': prefix,
|
||||||
|
|
Loading…
Reference in a new issue