cstadther / adventure-import-export

A module for Foundy VTT for packaging and installing adventures.
MIT License
15 stars 7 forks source link

Allow importing compendia that may already exist #77

Open AJAnderson opened 4 years ago

AJAnderson commented 4 years ago

Instead of erroring out when a compendium already exists, allow skipping this compendium, or better yet, allow skip OR replace. Ideally allow this on a case by case or all at once, similar to a standard file system dialog copy and paste operation.

cstadther commented 4 years ago

Are you talking about the compendium items? or the full compendium? It should not "error" out when a compendium already exists. It first checks if a compendium with the same name/entity combination exists based on the exported compendium metadata. If it doesn't it creates a new compendium, if it does it returns the compendium for update. Next it goes through all the items and checks to see if the item already exists in the compendium, if it does then it skips that item, otherwise it creates it.

I agree that it should probably prompt the user if they want to replace or ignore the data for an existing compendium item. I think a dialog at the beginning of import for each compendium would be best, as I have compendiums that have thousands of and would not want to be prompted on each one.