The logic in component.py::Mod.__post_init__ is the correct logic to locate plugins in the proper location.
This logic needs to be moved somewhere that it can be recycled because it's also needed when deleting plugins.
It should also store full file path instead of just the name as a string, then comparisons for that filename need to be updated.
With the proposed changes, deleting plugins will no longer delete plugins from anywhere in that mod's files, in case that mod had the same plugin in multiple locations.
The logic in
component.py::Mod.__post_init__
is the correct logic to locate plugins in the proper location.This logic needs to be moved somewhere that it can be recycled because it's also needed when deleting plugins.
It should also store full file path instead of just the name as a string, then comparisons for that filename need to be updated.
With the proposed changes, deleting plugins will no longer delete plugins from anywhere in that mod's files, in case that mod had the same plugin in multiple locations.