earlSt1 / vtt-compendium-folders

Collapsable folders in the compendium directory and folder structures inside compendiums for FoundryVTT
21 stars 18 forks source link

Feature Request: Merge owned items by name #113

Open SalieriC opened 2 years ago

SalieriC commented 2 years ago

Describe the bug When exporting folder structure of actors, merging existing ones, some items are duplicated instead of overwritten.

To Reproduce Steps to reproduce the behavior:

  1. Export folder structure of actors to a compendium.
  2. Edit some items on the actor(s)
  3. Export the same folder structure again, using merge.

Expected behavior Actors should overwrite actors completely (which is FVTT core behaviour), instead of exporting each embedded document individually per actor.

Screenshots image

Information

SalieriC commented 2 years ago

Just noticed that it does not happen with the same items so importing and then exporting the same data does not cause issues. I suspect it merges items with the same ID and adds items with a different one. This might be desirable in some cases but is troublesome in others. Merging owned items by name might be a way around this.

earlSt1 commented 2 years ago

Hi, so finally got round to checking this issue out. I tried replicating on my swade world with just CF enabled. I imported one of the creatures from the compendiums provided, exported it into another compendium, then edited the creature in my world and tweaked the range of one of the abilities. I then exported the folder structure and merged back into the new compendium. I couldnt get any duplicate items or anything though. The only difference I can see is that I'm on SWADE v0.21.1, perhaps that might fix your issue?

SalieriC commented 2 years ago

Hi @earlSt1. Thank you for checking it out. Please try adding a completely new item to the actor before merging it. I suspect that it merges everything on an actor and adding new stuff instead of merging the entire actor by name as I mentioned earlier. This may be intended or even core but if so please treat it as a feature request for a way to completely replacing actors by name instead of adding what's new and changing what's there because the way it is right now does not account for deleting things on an actor.

earlSt1 commented 2 years ago

Ahh gotcha, yep this looks like a missing functionality in Core (CF just uses the core functions for exporting actors to compendiums). I'll update this ticket.