only trigger activity on new files
This commit is contained in:
parent
a7db68236c
commit
e210d9329c
1 changed files with 10 additions and 7 deletions
|
@ -174,16 +174,19 @@ def run_import(options=None):
|
||||||
if listname:
|
if listname:
|
||||||
listitems.append(item.id)
|
listitems.append(item.id)
|
||||||
added += 1
|
added += 1
|
||||||
|
state.activity = {
|
||||||
|
'activity': 'import',
|
||||||
|
'progress': [position, len(books)],
|
||||||
|
'path': prefix,
|
||||||
|
'added': added,
|
||||||
|
}
|
||||||
|
trigger_event('activity', state.activity)
|
||||||
|
elif listname:
|
||||||
|
listitems.append(file.item.id)
|
||||||
|
|
||||||
if state.activity.get('cancel'):
|
if state.activity.get('cancel'):
|
||||||
state.activity = {}
|
state.activity = {}
|
||||||
return
|
return
|
||||||
state.activity = {
|
|
||||||
'activity': 'import',
|
|
||||||
'progress': [position, len(books)],
|
|
||||||
'path': prefix,
|
|
||||||
'added': added,
|
|
||||||
}
|
|
||||||
trigger_event('activity', state.activity)
|
|
||||||
if listname and listitems:
|
if listname and listitems:
|
||||||
l = List.get(settings.USER_ID, listname)
|
l = List.get(settings.USER_ID, listname)
|
||||||
if l:
|
if l:
|
||||||
|
|
Loading…
Reference in a new issue