# Asset Path Auto-Repair for Foundry VTT (V12–V14)
> 🇩🇪 **[Deutsche Dokumentation hier lesen (README.de.md)](./README.de.md)**



**Asset Path Auto-Repair** (`asset-path-repair`) is a comprehensive, production-grade administrative tool for **Foundry Virtual Tabletop (V12, V13, and V14, with V11 fallback)**. It recursively indexes selected directories inside your Foundry `Data/` storage, detects broken or orphaned media file references across your entire world's **LevelDB** database after filesystem reorganizations, and repairs them through a guided, collision-safe **4-step wizard**.
---
## Why This Module Exists: The LevelDB Path Migration Problem
Since Foundry VTT migrated its world database backend to **LevelDB**, asset paths (maps, tokens, portraits, handouts, audio tracks, and embedded HTML images) are stored inside binary LevelDB tables rather than simple flat `.db` text files.
When Game Masters reorganize their `Data/` folder on a local machine, NAS, Docker container, or dedicated server—such as moving loose files into structured folders like `assets/maps/`, `assets/tokens/`, or `assets/handouts/`—every previously linked path in the world breaks. Fixing hundreds of scenes, prototype tokens, placed tokens, and HTML journal entries by hand is tedious and error-prone.
**Asset Path Auto-Repair** solves this automatically:
1. It crawls your chosen `Data/` directories via Foundry's native `FilePicker` API.
2. It verifies whether each stored path in your world still exists at its current location.
3. For every orphaned path, it locates the moved file by filename, flags any multi-file ambiguities (**Collisions**), and rewrites the updated paths directly through Foundry's official Document update APIs.
---
## Key Features
| Feature | Description |
| :--- | :--- |
| **4-Step Interactive Wizard** | Guided workflow: **1. Select Folders** → **2. Dry-Run Preview & Collision Resolution** → **3. Confirm & Apply Updates** → **4. Final Audit Summary**. |
| **Protected Folder Safeguards** | System folders (`systems`, `modules`, `worlds`, `icons`, `ui`) are unchecked by default. Checking any protected folder displays an immediate inline warning about icon collisions and scan overhead. |
| **Full Foundry V14 Data Coverage** | Scans Scenes, Tiles, Placed Tokens (including V12/V14 Dynamic Token Ring `ring.subject.texture`), Ambient Sounds, Map Notes, Actors, Prototype Tokens, Owned Items, Active Effects, World Items, Journals, Playlists, Rollable Tables, Card Stacks, and Macros. |
| **HTML Handout & Biography Parser** | Parses embedded HTML inside Journal Text Pages (`page.text.content`), Actor biographies, and Item descriptions for ``, `