Browse Source

Only unquote once in `getMaterialFilePackageId`

c.lamboo 2 years ago
parent
commit
3dad5d564d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cura/CuraPackageManager.py

+ 1 - 1
cura/CuraPackageManager.py

@@ -83,11 +83,11 @@ class CuraPackageManager(PackageManager):
 
 
     def getMaterialFilePackageId(self, file_name: str, guid: str) -> str:
     def getMaterialFilePackageId(self, file_name: str, guid: str) -> str:
         """Get the id of the installed material package that contains file_name"""
         """Get the id of the installed material package that contains file_name"""
+        file_name = unquote_plus(file_name)
         for material_package in [f for f in os.scandir(self._installation_dirs_dict["materials"]) if f.is_dir()]:
         for material_package in [f for f in os.scandir(self._installation_dirs_dict["materials"]) if f.is_dir()]:
             package_id = material_package.name
             package_id = material_package.name
 
 
             for root, _, file_names in os.walk(material_package.path):
             for root, _, file_names in os.walk(material_package.path):
-                file_name = unquote_plus(file_name)
                 if file_name not in file_names:
                 if file_name not in file_names:
                     # File with the name we are looking for is not in this directory
                     # File with the name we are looking for is not in this directory
                     continue
                     continue