Skip to content

Add option to skip syncing assets for installed systems and modules#86

Open
Noisyink wants to merge 1 commit into
ForgeVTT:masterfrom
Noisyink:asset-sync-skip-installed-packages
Open

Add option to skip syncing assets for installed systems and modules#86
Noisyink wants to merge 1 commit into
ForgeVTT:masterfrom
Noisyink:asset-sync-skip-installed-packages

Conversation

@Noisyink

@Noisyink Noisyink commented Jun 22, 2026

Copy link
Copy Markdown

Closes #24.

Adds an Asset Sync toggle (on by default) that skips downloading assets under modules/<id>/ and systems/<id>/ when <id> is an installed package, since those files are recreated locally on package install. Assets for packages that are not installed still sync. The persistent-storage carve-out (<type>/<id>/storage/) always syncs when the manifest sets persistentStorage: true. World and compendium database rewrites are unaffected, since they still receive the full asset map.

First iteration: systems are detected via game.system.id only. Multi-system detection via FilePicker.browse is left for a follow-up, as discussed in the issue.

Test plan

Verified on Foundry v14.363 against a real Forge library of 39,542 assets, via a live Asset Sync run:

  • Toggle on: assets under installed modules/<id>/ and the current systems/<id>/ are skipped before any download. With four matching modules present in game.modules (764 + 25 + 9 + 4 assets), the console logged skipping 802 assets/folders belonging to installed packages and none of those folders received files.
  • Persistent-storage carve-out: with one of those modules declaring persistentStorage: true, the skip count dropped to 796, i.e. its six storage/ entries synced instead of being skipped.
  • Packages not present in game.modules, and any non-current system, still sync. Paths outside modules//systems/ are never skipped.
  • Predicate spot-checked in the console against real installed packages (game.modules / game.system.id), including the apiKeyPath-prefix and storage/ edge cases.
  • Toggle off: behaviour is identical to current (nothing skipped); the predicate short-circuits to false.

Adds a new sync toggle 'Skip assets for installed systems & modules
(recreated on install)' that is checked by default. When enabled,
assets under modules/<id>/ for any installed module and under
systems/<id>/ for the active system are excluded from the download
pass, since a local package install recreates those files. A
persistent-storage carve-out always syncs <type>/<id>/storage/
when the package declares persistentStorage in its manifest.

The full Forge inventory is kept for the WorldMigration DB-rewrite
step so that references to skipped assets are still remapped to
their local paths correctly.

Implements iteration 1 of ForgeVTT#24.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Noisyink Noisyink marked this pull request as ready for review June 22, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asset sync toggle to optionally ignore assets within systems/modules

1 participant