ComfyUI/app/assets
Alexander Brown 942b2a6526
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Add pruning of Assets not reachable through the current configs (#12168)
* Not sure about this one, but try removing assets from old sessions.

* Simplify _prune_orphaned_assets: merge functions, use list comprehensions

Amp-Thread-ID: https://ampcode.com/threads/T-019c0917-0dc3-75ab-870d-a32b3fdc1927
Co-authored-by: Amp <amp@ampcode.com>

* Refactor _prune_orphaned_assets for readability

Amp-Thread-ID: https://ampcode.com/threads/T-019c0917-0dc3-75ab-870d-a32b3fdc1927
Co-authored-by: Amp <amp@ampcode.com>

* Add unit tests for pruning

* Add unit tests for _prune_orphaned_assets

Tests cover:

- Orphaned seed assets pruned when file removed

- Seed assets with valid files survive

- Hashed assets not pruned even without file

- Multi-root pruning

- SQL LIKE escape handling for %, _, spaces

Amp-Thread-ID: https://ampcode.com/threads/T-019c0c7a-5c8a-7548-b6c3-823e9829ce74
Co-authored-by: Amp <amp@ampcode.com>

* Ruff fix

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-01-29 18:34:14 -08:00
..
api Added @ROUTES.post("/api/assets/seed") for now to help with tests 2026-01-29 16:57:37 -08:00
database Order the tags by when they were added (Ends up being directory depth order) 2026-01-28 22:17:52 -08:00
hashing.py Add most basic Asset support for models (#11315) 2026-01-08 22:21:51 -05:00
helpers.py Finished @ROUTES.post("/api/assets") 2026-01-15 23:41:19 -08:00
manager.py Fixed issues in manager.py that had to do with creating a result after closing the db session 2026-01-29 16:58:48 -08:00
scanner.py Add pruning of Assets not reachable through the current configs (#12168) 2026-01-29 18:34:14 -08:00