This must be a silly question, but I can’t get my metadata agent to compile when it includes the line
image = Core.storage.load([path to image])
The error I get is NameError: global name ‘Core’ is not defined.
I’ve looked at the LocalMedia.bundle and it seems to be able to use Core without issues. There also doesn’t seem to be an import for Core . . . . What am I doing wrong ?
Further related question - is there any docs for the Core.storage API ?
Thanks,
Steve
The Core APIs are mostly internal/private functions, which aren’t available to plug-in code by default as they bypass a lot of the security restrictions applied by the framework. You can make them available by setting the PlexPluginCodePolicy key in Info.plist to Elevated. There’s no documentation for it (sorry) because we don’t want plug-ins using it unless it’s absolutely necessary, and most developers probably won’t need it
However, you can view the source & see which functions are available - Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/storage.py.
Ah, thanks.
All I’m trying to do it add a poster to a film from a local .tiff file. Is there a better way to do this without needing to use “Core.” ?
Thanks,
Steve
No, that’s the right thing to do - access to the local filesystem is one thing the plug-in sandbox prevents, so you’ll need to go via the Core API to achieve this 
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.