diff --git a/oml/library.py b/oml/library.py index 54902d1..510e7d2 100644 --- a/oml/library.py +++ b/oml/library.py @@ -44,6 +44,11 @@ class Peer(object): self.info['peers'] = {} if 'lists' not in self.info: self.info['lists'] = {} + for name in self.info['lists']: + if 'listorder' not in self.info: + self.info['listorder'] = [] + if name not in self.info['listorder']: + self.info['listorder'].append(name) def apply_log(self): changes = [] @@ -113,6 +118,10 @@ class Peer(object): query = args[1] if name not in self.info['lists']: self.info['lists'][name] = [] + if 'listorder' not in self.info: + self.info['listorder'] = [] + if name not in self.info['listorder']: + self.info['listorder'].append(name) elif action == 'editlist': name, new = args if name in self.info['lists']: