Skip to content
drinfernoo edited this page Apr 8, 2020 · 3 revisions

Folder Structure

To create a theme for Seren, you must first create the correct folder structure in your theme's root:

.
└── resources
    └── skins
        ├── Default
        |   ├── 1080i
        |   |   ├── custom_providers.xml
        |   |   ├── get_sources.xml
        |   |   ├── persistent_background.xml
        |   |   ├── playing_next.xml
        |   |   ├── resolver.xml
        |   |   ├── source_select.xml
        |   |   └── still_watching.xml
        |   └── media  // <-- Optional if no custom images will be needed
        └── meta.json

Probably the simplest way to get this structure into your theme is to copy the folder for Seren's base "Seren Fox" theme.

Any .xml files that you won't be theming are optional, and any missing ones will use the "Seren Fox" version of the window.

With the notable exception of not being able to create your own skin includes for use inside of Seren's windows (a base Kodi limitation imposed on addon-created windows), most any technique, information, or parameters outlined in the Skinning Manual should be applicable in any of the following windows as well.

Including Images in Your Theme

If you intend to include extra files/media with your theme, you can access the files by utilizing the skin.dir window property and appending the remaining file structure as it appears in your zip package.

Here is an example path to background.jpg in the optional media that is at the top level of the themes zip package:

<texture background="true">$INFO[Window().Property(skin.dir)]/media/background.jpg</texture>

Common Window Properties

Seren provides information to the themes through the window properties outlined below:

Property Description
seren.fanart Path to Seren's fanart image
seren.logo Path to Seren's icon image
settings.color The current color code set by the user in Seren's settings
skin.dir Path to the currently installed theme folder (your theme)
test_pattern Path to a test pattern that can be helpful when aligning items in the window
texture.white Path to a plain white image for use in diffusing/overlays

Common Item Properties

The following properties (which may potentially be unfilled) are available to all windows except custom_providers.xml:

Metadata Provider IDs

Property Description
item.ids.imdb_id IMDb ID
item.ids.tmdb_id TMDb ID
item.ids.trakt_id Trakt ID
item.ids.tvdb_id TVDB ID
item.ids.tvrage_id TVRage ID
item.ids.slug_id Trakt slug
item.ids.tvshow.imdb_id IMDb show ID
item.ids.tvshow.tmdb_id TMDb show ID
item.ids.tvshow.tvdb_id TVDB show ID
item.ids.tvshow.tvrage_id TVRage show ID
item.ids.tvshow.trakt_id Trakt show ID
item.ids.tvshow.slug_id Trakt show slug

Artwork

Property Description
item.art.banner URL to banner image
item.art.characterart URL to characterart image
item.art.characterart[1-20] URL to extra characterart images, 1-20
item.art.clearart URL to clearart image
item.art.clearlogo URL to clearlogo image
item.art.discart URL to discart image
item.art.fanart URL to fanart image
item.art.fanart[1-20] URL to extra fanart images, 1-20
item.art.landscape URL to landscape image
item.art.poster URL to poster image
item.art.poster[1-10] URL to extra poster images, 1-10
item.art.thumb URL to thumbnail image

For properties that can have multiple artworks, like for fanart, use item.art.fanart1, item.art.fanart2, item.art.fanart3, etc...

Content Metadata

Property Description
item.info.aliases List of alternative titles
item.info.aired The entire airdate/premiere, formatted as mm/dd/yyyy
item.info.aired.day The dd portion of the airdate/premiere
item.info.aired.month The mm portion of the airdate/premiere
item.info.aired.year The yyyy portion of the airdate/premiere
item.info.director Director
item.info.duration Duration in seconds
item.info.duration.hours Hour portion of the duration
item.info.duration.minutes Minutes portion of the duration
item.info.episode Episode number
item.info.genre List of applicable genres
item.info.imdbnumber IMDb ID
item.info.title Title
item.info.mediatype "movie" for movies, "episode" for episodes
item.info.mpaa MPAA rating
item.info.originaltitle Original title
item.info.playcount How many times the item has been played locally
item.info.plot Short plot outline
item.info.premiered The entire premiere date, formatted as mm/dd/yyyy
item.info.tagline Tagline
item.info.trailer URL to YouTube trailer
item.info.rating Rating out of 10
item.info.season Season number
item.info.sortepisode Episode number
item.info.sortseason Season number
item.info.sorttitle Episode title
item.info.tvshowtitle TV show title
item.info.year Year of release

All of the preceding common properties can be retrieved using $INFO[Window().Property(...)].

Scraping Window Properties

The following properties (which may potentially be unfilled) are available to the get_sources.xml window:

Property Description
1080p_sources Count of playable 1080p sources
4k_sources Count of playable 4k sources
720p_sources Count of playable 720p sources
cached_torrents Total count of all playable torrent sources
cloud_sources Total count of all cloud sources
hosters_sources Total count of all hosters sources
process_started a boolean value to identify that all setup for scraping has completed
progress Percentage of elapsed time in reference to the timeout for scraping
remaining_providers_count Count of all remaining providers
remaining_providers_list Pipe-separated list of remaining provider names
SD_sources Count of playable SD sources
total_torrents Total count of all torrent sources

Information Window Properties

The following property (which may potentially be unfilled) is available to the persistent_background.xml window:

Property Description
notification_text Text indicating the current step in scraping/playback

Source Select Item Properties

The following properties (which may potentially be unfilled) are available to the sources inside the source_select.xml window:

Property Description
debrid_provider Cloud service provider of the identified source
info Extra information about the identified source
language Expected language of the identified source
provider Provider of the identified source
quality Resolution of the identified source
release_title Release title (filename) of the identified source
size Estimated file size of the identified source
sourcec File locker of an identified Hoster source
type Source type (Torrent/Hoster/Cloud)

Resolving Window Properties

The following properties (which may potentially be unfilled) are available to the resolver.xml window:

Property Description
debrid_provider Cloud service provider of the identified source
source_info Extra information about the identified source
source_provider Provider of the identified source
source_resolution Resolution of the identified source
release_title Release title (filename) of the identified source

Required IDs

Each window has a set of IDs that must be included in the layout for the window to function correctly. They can be hidden using <visible>false</visible>, or by using a conditional visibility statement, but must be present, or the window will either not launch or not function correctly, or both.

custom_providers.xml

ID Control Type Control Description
2000 button Package List
2001 button Provider List
3001 button Enable All Hosters
3002 button Enable All Torrents
3003 button Disable All Hosters
3004 button Disable All Torrents
3005 button Enable All
3006 button Disable All
3007 button Enable Package
3008 button Disable Package
3009 button Install Package
3010 button Uninstall Package

get_sources.xml

ID Control Type Control Description
2000 list Remaining Providers List

playing_next.xml

ID Control Type Control Description
3001 button Play
3002 button Close
3014 progress Progress Bar

source_select.xml

ID Control Type Control Description
1000 list Source List

still_watching.xml

ID Control Type Control Description
3001 button Play
3002 button Close
3014 progress Progress Bar

Theme Metadata

Located in the "skins" folder of your theme must be a file named meta.json, which contains the following lines:

{
    "skin_name": "Your Theme Name",
    "version": "1.0.0",
    "author": "Your Name"
}

This file tells Seren the necessary information about your theme, as well as allowing Seren to automatically check for theme updates, as long as the theme was installed from a URL.

Hosting on GitHub

One of the easiest ways to distribute Seren themes is to host them on GitHub. If the root of your GitHub repository is the root of your theme directory, then the installation link will be of the form:

https://www.github.com/YOUR_USERNAME/YOUR_REPOSITORY/zipball/YOUR_BRANCH

The final YOUR_BRANCH placeholder will be master in most cases, but can be used with different branches in order to distribute multiple versions (testing, different skin support, etc...) of your theme.

Distributing via Zip

If you opt to distribute your theme "manually", by packaging it into a .zip file yourself, ensure that the root of the .zip file matches the structure shown at the very top of this page, without being nested inside of a top-level "parent" folder.