chg: Get UUIDs sorted from most recent to oldest.

pull/559/head
Raphaël Vinot 2022-12-07 21:18:38 +01:00
parent 8083c8cabc
commit 2c6d6b2556
1 changed files with 1 additions and 1 deletions

View File

@ -384,7 +384,7 @@ class Lookyloo():
'''Get all the captures in the cache, sorted by timestamp (new -> old).
By default, this method will only return the captures that are currently cached.'''
if capture_uuids is None:
all_captures = self.redis.hgetall('lookup_dirs')
all_captures = {k: v for k, v in sorted(self.redis.hgetall('lookup_dirs').items(), key=lambda item: item[1], reverse=True)}
if index_cut_time is None:
capture_uuids = list(all_captures.keys())
else: