5.1.1. Plugin — Configures the plug-in and the runtime environment¶
The Plugin module contains functions for setting up the plug-in and it’s environment. Most of the functions in this module should be used within the plug-in’s Start() function.
This module defines the following functions:
- Plugin.AddViewGroup(name, viewMode="List", mediaType="items")¶
Registers a new view group with the framework. View groups, when applied to MediaContainer objects, allow you to control how the containers are displayed within Plex.
This function should only be called from the Start() method.
Parameters: - name (str) – The name of the view group
- viewMode (str) – The view mode to use, valid values are: “List”, “InfoList”, “MediaPreview”, “Showcase”, “CoverFlow”, “PanelStream”, “WallStream”
- mediaType (str) – The media type to display
- Plugin.ViewGroups()¶
Returns all view groups registered with the framework. The view groups are returned as a dictionary. The key of each item is the view group’s name, and the value is a second dictionary, containing the keys ViewMode and MediaType, and the values provided when creating the view group.
Returns: Registered view group information Return type: dict
- Plugin.Prefixes()¶
Returns all prefixes registered with the framework.
Returns: Registered prefixes Return type: list
- Plugin.Restart()¶
Restarts the plug-in.
Note
No code will execute after this point - the plug-in will be terminated, along with the runtime environment, and a new session will be started by the media server.