cleanup time added
This commit is contained in:
parent
a01e574a8f
commit
ca29c73043
1 changed files with 6 additions and 0 deletions
|
@ -172,11 +172,17 @@ def run_scan():
|
||||||
elif user not in file.item.users:
|
elif user not in file.item.users:
|
||||||
item = file.item
|
item = file.item
|
||||||
item.add_user(user)
|
item.add_user(user)
|
||||||
|
|
||||||
logger.debug('add %s to local user', id)
|
logger.debug('add %s to local user', id)
|
||||||
add_record('additem', item.id, file.info)
|
add_record('additem', item.id, file.info)
|
||||||
add_record('edititem', item.id, item.meta)
|
add_record('edititem', item.id, item.meta)
|
||||||
item.update()
|
item.update()
|
||||||
added += 1
|
added += 1
|
||||||
|
if file and not file.item.added:
|
||||||
|
file.item.added = datetime.utcnow()
|
||||||
|
if file.item.accessed:
|
||||||
|
file.item.added = file.item.accessed
|
||||||
|
file.item.save()
|
||||||
library_items = len(user.library.items)
|
library_items = len(user.library.items)
|
||||||
if added:
|
if added:
|
||||||
trigger_event('change', {})
|
trigger_event('change', {})
|
||||||
|
|
Loading…
Reference in a new issue