User Tools

Site Tools


serviio_groovy_plugins_explained

This is an old revision of the document!


Here is how Serviio creates its Online Menus for RSS/Atom Feeds:

When an RSS feed Url is added and saved as a “Video”,“Audio” or “Image” “Online RSS/Atom feed” for a “Source URL” in the “Online sources” tab within the “Library” tab of the “Serviio Console”, Serviio will perform the following actions:

1. It will attempt to access the RSS xml file using the provided feed Url.

2. It will look at the file header to ensure it is an RSS, and get the rss <title> tag for use as the “Online” Menu item title.

3. It will examine the content of the file for <item> tags containing a <title> tag, a <media:content url= > or <enclosure url = tag , and optionally a <media:thumbnail url = tag.

4. If these are present and the Url's have extensions consistent with the media type set in the Console for the RSS feed Url, Serviio will create an “Online” Menu item with the rss title, and a menu using the defined thumbnail url (if any) and the item title, for each item with a valid content url.

5. If no content url is present, Serviio will call the “Extractor Matches” function (called “methods” in the java/groovy language) in each .groovy found in the plugins directory, passing the name of the RSS feed url, until one of the groovys returns a value of “true”, indicating it can process this feed.

6. Serviio then calls the “Extractor Name” function in that .groovy and the .groovy returns its name to Serviio for logging purposes.

7. Serviio then for each <item>, creates an array (called a “map” in the java/groovy language) of the any urls found in any <link> tags in the <item> and then calls the “ExtractURL” function in the .groovy, passing the links array and the Preferred Quality as defined in the Console.

8. For each <item> the .groovy is responsible for returning a valid media content url preferably matching the Preferred quality and optionally a thumbnail url to Serviio.

9. Serviio then creates an “Online” Menu item with the rss title, and will create menu items for each returned thumbnail url (if any) and valid returned content url.

The best way to learn how groovys determine the content and thumbnail urls is to examine the existing .groovy plugins created by others utilizing the “Serviio Online Feed Plugin implementation Guide.pdf” located at http://forum.serviio.org/viewtopic.php?f=22&t=3274

serviio_groovy_plugins_explained.1321218797.txt.gz · Last modified: 2011/11/13 21:13 by jhb50