Sort items by time

This commit is contained in:
Tim Van Baak 2019-07-09 12:26:13 -07:00
parent 875da67437
commit be7804a1e5
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ def root():
total += 1 total += 1
if not any(map(lambda f: f(item), filters)): if not any(map(lambda f: f(item), filters)):
active_items.append(item) active_items.append(item)
# Sort items by time
active_items.sort(key=lambda i: i['time'] if 'time' in i else 0)
logger.info("Returning {} of {} items".format(len(active_items), total)) logger.info("Returning {} of {} items".format(len(active_items), total))
if item_read_exceptions: if item_read_exceptions:
read_ex = { read_ex = {