Get all installed presets with valid metadata. Returns a deep copy of presets with dict metadata only. Corrupted entries (non-dict values) are filtered out. Returns: Dictionary of pack_id -> metadata (deep copies), empty dict if corrupted
(self)
| 462 | return copy.deepcopy(entry) |
| 463 | |
| 464 | def list(self) -> Dict[str, dict]: |
| 465 | """Get all installed presets with valid metadata. |
| 466 | |
| 467 | Returns a deep copy of presets with dict metadata only. |
| 468 | Corrupted entries (non-dict values) are filtered out. |
| 469 | |
| 470 | Returns: |
| 471 | Dictionary of pack_id -> metadata (deep copies), empty dict if corrupted |
| 472 | """ |
| 473 | packs = self.data.get("presets", {}) or {} |
| 474 | if not isinstance(packs, dict): |
| 475 | return {} |
| 476 | # Filter to only valid dict entries to match type contract |
| 477 | return { |
| 478 | pack_id: copy.deepcopy(meta) |
| 479 | for pack_id, meta in packs.items() |
| 480 | if isinstance(meta, dict) |
| 481 | } |
| 482 | |
| 483 | def keys(self) -> set: |
| 484 | """Get all preset IDs including corrupted entries. |