Share Preferences between two plugins

I am developing two plugins that are intended to be used together.

Plugin1 will be a daemon that scans a directory for files, then creates a symbolic link to a video file in another directory. (This isn’t important to my question, but the source file could be ‘\folder\file.ext’, then the symbolic link would be named ‘{folder}file{ext}.mp4’ which doesn’t link to the file.ext, but to a different video file.)

Plugin2 is a metadata agent that, obviously, searches and collects the metadata.

The issue is both plugins need to know the root directory of the source. I.e ‘root\folder\file.ext’ Ideally this would be set in the preferences of the plugin, but I don’t want to have the user set it twice with the possibility of a mismatch.

Is it possible to share the preferences? Or what other ways can I work around this?

For anyone else looking to solve something similar.

For now I ended up going another route.

Instead of making 2 plugins I am making 1 plugin and another script that runs external to plex. The script will use the preferences from the plugin.

The script gets the the data folder location and then gets the preferences file from the data directory and parses it.

A few ways to get the data directory depending on your situation.

One way is to use the python plexapi module. appdata = plex.settings.LocalAppDataPath… This should work from within a plugin (although I’m told it won’t work on anything except windows, can’t test on linux…)

Another way is to get the directory of the python script itself and then build the directory structure depending on where you places the script inside the data folder. I don’t know if this will work within a plugin as I think plex doesn’t use the python files in their original locations, but instead creates a virtual python environment… so possible this won’t work if it’s a plugin.