trigger status for all peers on ws connect
This commit is contained in:
parent
2c61fcc111
commit
0cc3a4523e
2 changed files with 9 additions and 3 deletions
|
|
@ -109,6 +109,12 @@ class User(db.Model):
|
|||
def is_online(self):
|
||||
return state.nodes and state.nodes.is_online(self.id)
|
||||
|
||||
def trigger_status(self):
|
||||
trigger_event('status', {
|
||||
'id': self.id,
|
||||
'online': self.is_online()
|
||||
})
|
||||
|
||||
def lists_json(self):
|
||||
self.library
|
||||
return [l.json() for l in self.lists.order_by('index_')]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue