fix(example-images): exclude failed_models from check_pending_models pending count

Previously check_pending_models() only skipped models already in
processed_models, so models that had permanently failed (no CivitAI
images available, download errors) were forever reported as "pending".
This caused repeated auto-download cycles with no actual work to do.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Will Miao
2026-05-28 12:00:25 +08:00
parent 3919dfa3f4
commit 3f6824eef6

View File

@@ -397,13 +397,12 @@ class DownloadManager:
models_with_hash = len(all_models_with_hash)
# Calculate pending count: check which models actually need processing
# A model is pending if it has a hash, is not in processed_models,
# and its folder doesn't exist or is empty
# Calculate pending count: check which models actually need processing.
# A model is pending if it has a hash, is not already processed or known-failed,
# and its folder doesn't exist or is empty.
pending_hashes = set()
for model_hash, model_name in all_models_with_hash:
if model_hash not in processed_models:
# Check if model folder exists with files
if model_hash not in processed_models and model_hash not in failed_models:
model_dir = ExampleImagePathResolver.get_model_folder(
model_hash, active_library
)