only trigger activity on new files

This commit is contained in:
j 2014-05-26 12:41:01 +02:00
parent a7db68236c
commit e210d9329c

View file

@ -174,9 +174,6 @@ def run_import(options=None):
if listname: if listname:
listitems.append(item.id) listitems.append(item.id)
added += 1 added += 1
if state.activity.get('cancel'):
state.activity = {}
return
state.activity = { state.activity = {
'activity': 'import', 'activity': 'import',
'progress': [position, len(books)], 'progress': [position, len(books)],
@ -184,6 +181,12 @@ def run_import(options=None):
'added': added, 'added': added,
} }
trigger_event('activity', state.activity) trigger_event('activity', state.activity)
elif listname:
listitems.append(file.item.id)
if state.activity.get('cancel'):
state.activity = {}
return
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: