Open JarrodPo opened 3 years ago
I forgot to note I was creating my compendiums in code, not though the UI, so there is probably something with this api I should have done.
async function createCompendium(name) {
const nameLowerHypen = name.replace(/\s/g, '-').toLowerCase();
return await Compendium.create({
"label": name,
"entity": "Item",
"name": nameLowerHypen,
"path": "packs/" + nameLowerHypen + ".db",
"system": "swade"
})
}
Hi, yeah this will happen because the module stores some metadata about the compendiums in order to sort them into folders. I'll see about including this in a future release but for now you should be able to remove the entry that I create programatically using this (it may need to be before your Compendium.delete()
not after):
await game.customFolders.compendium.entries.get(packCode).delete();
It tells me that the delete method is undefined.
game.customFolders.compendium.entries.get(packCode).delete()
The CompendiumFolder object does have a delete method, but I'm not trying to delete the whole folder.
game.customFolders.compendium.folders.entries[0].delete()
Ah looks like i forgot to include the delete method for entries. I'm not sure if there is currently a way to programmatically delete compendiums in that case. I'm currently working on getting compendium folders working for 0.8.x, but if i have some time ill modify the testing version and you can test it.
If I delete more than one custom pack in a loop I get this error.