fix sync_metadata peer sort
This commit is contained in:
parent
4d9d54ad8f
commit
168b293514
1 changed files with 5 additions and 2 deletions
|
@ -325,8 +325,11 @@ class Item(db.Model):
|
|||
if self.meta.get('sharemetadata'):
|
||||
return
|
||||
peers = [u for u in self.users if u.id != settings.USER_ID]
|
||||
peers.sort(key=lambda u: ox.sort_string(str(u.info.get('index', ''))
|
||||
+ 'Z' + (u.info.get('name') or '')))
|
||||
def peer_sort(u):
|
||||
info = u.json()
|
||||
return ox.sort_string(str(info.get('index', ''))
|
||||
+ 'Z' + (info.get('name') or ''))
|
||||
peers.sort(key=peer_sort)
|
||||
sync_from = None
|
||||
first_peer = None
|
||||
# get first peer with sharemetadata set
|
||||
|
|
Loading…
Reference in a new issue