Fixed so that CompendiumBrowserSettings saves source/pack names as slugified version to avoid foundrdy not saving names with dots in the middle

This commit is contained in:
WBHarry 2026-05-20 17:10:19 +02:00
parent 2f589c1b8e
commit ca29903a56
3 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,5 @@
import { slugify } from '../../helpers/utils.mjs';
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
export default class CompendiumBrowserSettings extends HandlebarsApplicationMixin(ApplicationV2) {
@ -50,11 +52,12 @@ export default class CompendiumBrowserSettings extends HandlebarsApplicationMixi
const excludedSourceData = this.browserSettings.excludedSources;
const excludedPackData = this.browserSettings.excludedPacks;
context.typePackCollections = game.packs.reduce((acc, pack) => {
const { type, label, packageType, packageName: basePackageName, id } = pack.metadata;
const { type, label, packageType, packageName: basePackageName, id: baseId } = pack.metadata;
if (!CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc;
const id = slugify(baseId);
const isWorldPack = packageType === 'world';
const packageName = isWorldPack ? 'world' : basePackageName;
const packageName = isWorldPack ? 'world' : slugify(basePackageName);
const sourceChecked =
!excludedSourceData[packageName] ||
!excludedSourceData[packageName].excludedDocumentTypes.includes(type);