Forgive me if this is already documented somewhere. If so, I would ask to be pointed in that direction.
Given this snippet of information:
* '%LOCALAPPDATA%\Plex Media Server\' # Windows Vista/7/8
* '%USERPROFILE%\Local Settings\Application Data\Plex Media Server\' # Windows XP, 2003, Home Server
* '$HOME/Library/Application Support/Plex Media Server/' # Mac OS
* '$PLEX_HOME/Library/Application Support/Plex Media Server/', # Linux
* '/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/', # Debian,Fedora,CentOS,Ubuntu
* '/usr/local/plexdata/Plex Media Server/', # FreeBSD
* '/usr/pbi/plexmediaserver-amd64/plexdata/Plex Media Server/', # FreeNAS
* '${JAIL_ROOT}/var/db/plexdata/Plex Media Server/', # FreeNAS
* '/c/.plex/Library/Application Support/Plex Media Server/', # ReadyNAS
* '/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/', # QNAP
* '/volume1/Plex/Library/Application Support/Plex Media Server/', # Synology, Asustor
* '/raid0/data/module/Plex/sys/Plex Media Server/', # Thecus
* '/raid0/data/PLEX_CONFIG/Plex Media Server/' # Thecus Plex community
What would be a recommended way to programmatically get the Plex Main Folder location?
Is there an environment variable I can inspect or something? Or do I need to query the os/platform and determine this manually?