mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 20:39:25 -03:00
fix(update): respect hide_early_access_updates in refresh toast count
The refresh_model_updates handler was calling record.has_update() with default hide_early_access=False, causing the toast to report early-access updates that the Updates filter (which uses the user's hide_early_access setting) would then hide. This resulted in misleading "Found N updates" toasts followed by an empty Updates view. Now the handler reads hide_early_access_updates from settings and passes it to has_update(), matching the behavior of _serialize_record and _annotate_update_flags.
This commit is contained in:
@@ -2016,10 +2016,21 @@ class ModelUpdateHandler:
|
|||||||
self._logger.error("Failed to refresh model updates: %s", exc, exc_info=True)
|
self._logger.error("Failed to refresh model updates: %s", exc, exc_info=True)
|
||||||
return web.json_response({"success": False, "error": str(exc)}, status=500)
|
return web.json_response({"success": False, "error": str(exc)}, status=500)
|
||||||
|
|
||||||
|
hide_early_access = False
|
||||||
|
if self._settings is not None:
|
||||||
|
try:
|
||||||
|
hide_early_access = bool(
|
||||||
|
self._settings.get("hide_early_access_updates", False)
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
serialized_records = []
|
serialized_records = []
|
||||||
for record in records.values():
|
for record in records.values():
|
||||||
has_update_fn = getattr(record, "has_update", None)
|
has_update_fn = getattr(record, "has_update", None)
|
||||||
if callable(has_update_fn) and has_update_fn():
|
if callable(has_update_fn) and has_update_fn(
|
||||||
|
hide_early_access=hide_early_access
|
||||||
|
):
|
||||||
serialized_records.append(self._serialize_record(record))
|
serialized_records.append(self._serialize_record(record))
|
||||||
|
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
|
|||||||
Reference in New Issue
Block a user