PDA

View Full Version : Potential Issue with Extension.getExtensionInfo documentation



Mad Nomad
April 6th, 2022, 19:33
The getExtensionInfo function calls for "name" as input. But it actually required extensionID as input.
When you do an Extension.getExtensions() call it returns extension IDs that match the file name in the extensions folder. This is not always the same as the extensions "name" attribute, which is something returned with a get ExtensionInfo call.

extension ID seems to be an undocumented property of extensions
I'd recommend adding that into API wiki and changing the function call documentation to indicate it requires an extension ID instead of "name" which can be misinterpreted as the name property

Moon Wizard
April 6th, 2022, 20:33
There's an internal "name" and a display "name" for each package type (ruleset, extension, module).

All packages are referred to by their internal "name" as the "key". The internal "name" defaults to the file/folder name of the package, but then the formats differ with "name" in rulesets and extensions being the display name; while "name" in modules is an override with a separate "displayname". It's a legacy thing from FGC.

I've updated the Extension.getExtensionInfo and Module.getModuleInfo API documentation; as well as adding Interface.getRulesetInfo documentation.

Regards,
JPG