User Tools

Site Tools


serviio_groovy_plugins_explained

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 rss file for <item> tags containing a <title> tag, a <media:content url= > or <enclosure url = tag , and optionally a <media:thumbnail url = tag. For each item it will retain a title, a content url and a thumbnail url.

4. Serviio then calls 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.

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

6. 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.

7. For each <item> the .groovy is responsible for returning a valid content url preferably matching the Preferred quality and optionally a thumbnail url, and Serviio will override any content or thumbnail url values found in the rss in Step 3 above.

8. For each valid content url with an extension consistent with the media type set in the Console for the RSS feed Url, Serviio will then create and display an “Online” Menu folder with the rss title from step 2, and a menu using the thumbnail url from step 7 and the item title from step 3.

9. When an item is selected from the “Online” menu, Serviio will cause the content url from step 7 to be played.

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.txt · Last modified: 2014/05/22 19:00 by illico