don't use notin_ with all items
This commit is contained in:
parent
37046903e0
commit
c842c3ae90
1 changed files with 10 additions and 9 deletions
|
@ -313,15 +313,16 @@ def sync_db():
|
|||
if sort_ids:
|
||||
t0 = time.time()
|
||||
commit = False
|
||||
for i in item.models.Item.query.filter(item.models.Item.id.notin_(sort_ids)):
|
||||
i.update(commit=False)
|
||||
if i.info['mediastate'] == 'unavailable' and state.tasks:
|
||||
state.tasks.queue('getpreview', i.id)
|
||||
commit = True
|
||||
#logger.debug('sync:%s', i)
|
||||
t0 = maybe_commit(t0)
|
||||
if state.shutdown:
|
||||
break
|
||||
for i in item.models.Item.query:
|
||||
if i.id not in sort_ids:
|
||||
i.update(commit=False)
|
||||
if i.info['mediastate'] == 'unavailable' and state.tasks:
|
||||
state.tasks.queue('getpreview', i.id)
|
||||
commit = True
|
||||
#logger.debug('sync:%s', i)
|
||||
t0 = maybe_commit(t0)
|
||||
if state.shutdown:
|
||||
break
|
||||
if commit:
|
||||
state.db.session.commit()
|
||||
cleanup_lists()
|
||||
|
|
Loading…
Reference in a new issue