newbie preferences question

How does a developer specify what preferences they want to store?  Been searching the documentation and found how to set the defaults using the JSON preferences file.  But the plug-ins I'm working with do not use a preferences file yet have their own custom preferences.  I can see in the code where those plug-ins read the preferences but not where they define them.

 

There is an older forum entry that said to use Prefs.add(....) but I don't see that in the current documentation nor do the plug-ins I'm using as examples use that.

 

Feel like I'm missing something very basic.  Any help is appreciated.

All preferences are declared in a JSON file with the name DefaultPrefs.json if the file is part of the channel bundle. Example: https://github.com/plexinc-plugins/Put.io.bundle/blob/master/Contents/DefaultPrefs.json

If your channel makes use of a URL Service and the service and/or channel requires access to those preferences, you can make a ServicePrefs.json file. Example: https://github.com/plexinc-plugins/AmazonInstantVideo.bundle/blob/master/Contents/Services/URL/AmazonInstantVideo/ServicePrefs.json

Prefs.add(...) is a very old way to declare preferences and is no longer being used.

Thanks.  So a follow up question...  I'm making some changes to the YouTube plugin.  It does not have a DefaultPrefs.json file nor a ServicePrefs.json file as part of the bundle.  Yet it has preferences for region, a user ID and password.  What am I missing?  I can create a DefaultPrefs.json file but I'm thinking there must be something I need to do to undo about the current preferences setup. 

Thanks.  So a follow up question...  I'm making some changes to the YouTube plugin.  It does not have a DefaultPrefs.json file nor a ServicePrefs.json file as part of the bundle.  Yet it has preferences for region, a user ID and password.  What am I missing?  I can create a DefaultPrefs.json file but I'm thinking there must be something I need to do to undo about the current preferences setup. 

URL Services can be included in a channel bundle, but they can also be placed inside Services.bundle. The services in the Services.bundle can be used outside of channels, for example with the Plex It! bookmarklet.

The YouTube service and preferences file are included in this Services bundle: https://github.com/plexinc-plugins/Services.bundle/tree/master/Contents/Service%20Sets/com.plexapp.plugins.youtube/URL/YouTube

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.