diff --git a/plugins/VersionUpgrade/VersionUpgrade30to31/VersionUpgrade30to31.py b/plugins/VersionUpgrade/VersionUpgrade30to31/VersionUpgrade30to31.py index 4672cb1488..7064da09ad 100644 --- a/plugins/VersionUpgrade/VersionUpgrade30to31/VersionUpgrade30to31.py +++ b/plugins/VersionUpgrade/VersionUpgrade30to31/VersionUpgrade30to31.py @@ -45,6 +45,15 @@ _OLD_NOT_SUPPORTED_PROFILES = [ ] +# Some containers have their specific empty containers, those need to be set correctly. +_EMPTY_CONTAINER_DICT = { + "1": "empty_quality_changes", + "2": "empty_quality", + "3": "empty_material", + "4": "empty_variant", +} + + class VersionUpgrade30to31(VersionUpgrade): ## Gets the version number from a CFG file in Uranium's 3.0 format. # @@ -126,6 +135,11 @@ class VersionUpgrade30to31(VersionUpgrade): if quality_profile_id in _OLD_NOT_SUPPORTED_PROFILES: parser["containers"]["2"] = "empty_quality" + # fix empty containers + for key, specific_empty_container in _EMPTY_CONTAINER_DICT: + if parser.has_option("containers", key) and parser["containers"][key] == "empty": + parser["containers"][key] = specific_empty_container + # Update version numbers if "general" not in parser: parser["general"] = {}