-
Notifications
You must be signed in to change notification settings - Fork 41
Add ons
The website currently provides two sections of add-ons (the current version of Kodi and one version back). During beta for the next version of Kodi, that one is also added. The add-on section of the website for each Kodi version is created based on the addons.xml
file for that version and is downloaded from the mirrors each time the site is built. A custom Gatsby plugin parses the addons.xml
file and downloads images for any new/updated add-ons so that other Gatsby functions can build all the pages.
There are many pieces that work together to create the add-on section of the web site. This section provides an overview of that pieces. A section further down describes in detail how to setup a new section for a new version of Kodi.
The plugin was written, in theory, to be called multiple times with different settings, but current testing has shown that configuration doesn't work properly. Given that Each version of Kodi requires a separate copy of the plugin tagged with the version name at the end. (So gatsby-source-kodiaddon-matrix
for the Matrix add-ons). The plugin downloads a copy of the addons.xml
file and parses it. It also reads a file in src/data/addons/<version>/featured.xml
to tag the featured addons for the main add-ons page and a file in src/data/addons/<version>/history.json
that helps the build system know which add-ons are new/updated. When the parsing is complete, the history.json
file is updated.
Each version of the plugin requires an entry in plugins section of the gatsby-config.js
file. Here's what that looks like:
{
resolve: "gatsby-source-kodiaddon-matrix",
options: {
kodiversion: "matrix",
kodimirror: "ftp.halifax.rwth-aachen.de/xbmc",
},