2014-12-21, 03:39
As this is a beginners thread, I think it might be worthwhile explaining something that confused me when I first started; the difference between an Addon, Plugin, and Service.
Service:
This an addon that runs when Kodi first starts. It can be created with an infinite loop so that it stays active until it is disabled by the user, or Kodi shuts down. Generally a service operates without the users intervention, and uses automatic messages from Kodi as inputs. The Monitor and Player classes track these automatic messages for the system (library updates, etc) and media playing respectively.
Addon:
This is an ordinary script that is run by the user. It runs through once, but pauses at various points to allow user input. Unlike a service, it doesnt leave anything running. The script doesnt end until the user closes the Addon.
Plugin:
This is a special kind of Addon that runs through completely, from start to finish, whenever it is called. It does not pause to wait for user input. It can be called with various arguments that change its behaviour. For instance, if it is called without any arguments, eg my_plugin_script, if may load a list of video categories. Clicking on one of those categories will call the script again but with an argument that will load a certain sub-category, eg my_plugin_script category1. The plugin check the arguments and then displays different categories or plays a stream or file.
Module:
This is a special category of addon that provides libraries for other addons to use. These additional libraries are ones that are not found in the standard python library.
Service:
This an addon that runs when Kodi first starts. It can be created with an infinite loop so that it stays active until it is disabled by the user, or Kodi shuts down. Generally a service operates without the users intervention, and uses automatic messages from Kodi as inputs. The Monitor and Player classes track these automatic messages for the system (library updates, etc) and media playing respectively.
Addon:
This is an ordinary script that is run by the user. It runs through once, but pauses at various points to allow user input. Unlike a service, it doesnt leave anything running. The script doesnt end until the user closes the Addon.
Plugin:
This is a special kind of Addon that runs through completely, from start to finish, whenever it is called. It does not pause to wait for user input. It can be called with various arguments that change its behaviour. For instance, if it is called without any arguments, eg my_plugin_script, if may load a list of video categories. Clicking on one of those categories will call the script again but with an argument that will load a certain sub-category, eg my_plugin_script category1. The plugin check the arguments and then displays different categories or plays a stream or file.
Module:
This is a special category of addon that provides libraries for other addons to use. These additional libraries are ones that are not found in the standard python library.