mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
BE: spinner + timestamp work #1251
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -532,12 +532,14 @@ def update_devices_names(pm):
|
||||
last_checked_str = pm.name_plugins_checked
|
||||
last_checked_dt = parser.parse(last_checked_str) if isinstance(last_checked_str, str) else last_checked_str
|
||||
|
||||
# Find the most recent plugin update time among name-related plugins
|
||||
state_times = [
|
||||
pm.plugin_states.get(p, {}).get("stateUpdated")
|
||||
for p in name_plugins
|
||||
if pm.plugin_states.get(p)
|
||||
]
|
||||
# Collect valid state update timestamps for name-related plugins
|
||||
state_times = []
|
||||
for p in name_plugins:
|
||||
state_updated = pm.plugin_states.get(p, {}).get("stateUpdated")
|
||||
if state_updated and state_updated.strip(): # skip empty or None
|
||||
state_times.append(state_updated)
|
||||
|
||||
# Determine the latest valid stateUpdated timestamp
|
||||
latest_state_str = max(state_times, default=None)
|
||||
latest_state_dt = parser.parse(latest_state_str) if latest_state_str else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user