9 Commits
Author SHA1 Message Date
Will Miao 4db23e832f fix(example-images): stabilize ETA and persist download progress
- Blend a phase baseline with a 120s throughput window; reset the phase
  on pause and skip bursts so a resumed run is not estimated from the
  folders it skipped.
- Expose pause-aware elapsed_seconds and add a compact status response
  for the 2s progress poll.
- Save .download_progress.json from both download loops; the old save
  sat behind an early return on the common image path.
- Treat blank aiohttp errors and raised exceptions as transient, and
  bound gallery media at 25s (videos 180s) instead of the shared 300s
  socket read.
- Add tracker, manager, progress and timeout tests plus the full-run
  measurements.
2026-11-08 20:04:32 +08:00
Will Miao 04b26b2e9f perf(example-images): parallelize downloads and recover transient failures
- Add a shared MediaDownloadLimiter (default 6 concurrent) with a per-run
  429 cooldown and AIMD recovery; drop the empirical inter-model delay.
- Request width-aware Civitai renditions (800px images, transcoded 450px
  videos) and map Genur signed/direct URLs to c.genur.art _small.webp or
  _large.webp.
- Return an ImageDownloadOutcome so offline/connect/timeout/5xx failures
  stay transient instead of being written as downloadFailed; track
  retryable_models and leave those models pending.
- Force retries flagged Genur images and clears downloadFailed/downloadError
  only after a successful write, through the normal metadata save/cache path.
- Force bypasses the populated-folder guard; success is false when flagged
  images were skipped, so models are no longer falsely marked recovered.
- Add settings, tests, and a design/measurement note.
2026-11-08 18:05:02 +08:00
Will Miao 2193ec8f38 fix(example-images): support importing for Other models and pending hashes
Two gaps kept 'import example images' from working on the Other page:

- import_images/delete_custom_image/set_example_image_nsfw_level only
  searched the lora/checkpoint/embedding scanners, so Other-category
  models were never found ('Model with hash ... not found in cache').
  All three now go through a shared scanner list that includes the
  Other scanner.
- Other models (and fresh checkpoints) carry hash_status=pending with
  an empty sha256, so the frontend sent an empty model_hash and the
  import was rejected with 'Missing model_hash parameter'. The modal
  now also sends the model's file path, and the import use case
  resolves the hash on demand via the scanner's lazy-hash calculation.
  The resolved hash is returned to the UI and persisted on the
  showcase element so follow-up operations target the same
  hash-keyed folder.
2026-10-01 10:16:34 +08:00
Will Miao d2f955266d fix(types): resolve pre-existing basedpyright errors in tests
Fix ~790 basedpyright errors across the test suite:
- Type stub subclasses of real production classes with super().__init__()
- Add missing generic type arguments and Dict[str, Any] annotations
- Add None guards before subscript/member access
- Adapt tests to production API changes (removed dead handlers,
  PersistentModelCache.get_default, _i18n_filter_added location)
2026-08-08 20:12:59 +08:00
Will Miao 9087b4b07c feat(example-images): add missing-only download path and skip existing files
Split the single-model and bulk context menu actions into 'Download
Missing Example Images' (regular endpoint, skips already-processed
models) and 'Re-process Example Images' (force endpoint, retries
failed models).

- start_download accepts model_hashes so a selected subset can be
  processed with the progress-aware skip logic; explicitly targeted
  models bypass the failed/processed model-level guards so per-image
  gaps are filled
- pre-download existence check in the processor skips network requests
  for image files already on disk across all download paths
- force download retries previously failed models and clears their
  failed status on success
- add i18n keys for the new menu items across all locales
2026-08-03 20:52:46 +08:00
Will Miao 719e18adb6 feat(media): add media type hint support for file extension detection, fixes #795 and fixes #751
- Add optional `media_type_hint` parameter to `_get_file_extension_from_content_or_headers` method
- When `media_type_hint` is "video" and no extension can be determined from content/headers/URL, default to `.mp4`
- Pass image metadata type as hint in both `process_example_images` and `process_example_images_batch` methods
- Add unit tests to verify media type hint behavior and priority
2026-01-31 19:39:37 +08:00
Will Miao c9a65c7347 feat(metadata): implement model data hydration and enhance metadata handling across services, fixes #547 2025-10-09 22:15:07 +08:00
pixelpaws c53fa8692b refactor(settings): lazily initialize manager 2025-10-08 08:56:57 +08:00
pixelpaws fdec8d283c test(example-images): expand coverage for routes and utilities 2025-10-05 14:40:48 +08:00