Smart playlists/Examples

From Official Kodi Wiki
Jump to: navigation, search
Smart Playlists Contents

Home icon grey.png   ▶ Playlists ▶ Smart playlists ▶ Examples


Examples of XSP code for Smart Playlists.


1 Movies

1.1 In progress movies

Moives that are still in progress ordered by last played.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>In progress movies</name>
    <match>all</match>
    <rule field="inprogress" operator="true" />
    <order direction="descending">lastplayed</order>
</smartplaylist>


1.2 Last played movies (history)

Not in progress movies with a play count bigger than 0 ordered by last played.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Last played movies (history)</name>
    <match>all</match>
    <rule field="inprogress" operator="false" />
    <rule field="playcount" operator="greaterthan">
        <value>0</value>
    </rule>
    <order direction="descending">lastplayed</order>
</smartplaylist>


1.3 Movies with a specific subtitle language

Movies that contain Swedish (swe) internal subtitles.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Movies with Swedish subs</name>
    <match>all</match>
    <rule field="subtitlelanguage" operator="is">
        <value>swe</value>
    </rule>
    <group>none</group>
</smartplaylist>


1.4 One random movie

Only one movie is added to the playlist. This isn't possible to create in the GUI because the lower limit is 10 (or at least the limit needs to be edited afterward).
Even though the limit is only one you still need to set random order.

Though the difference between a playlist containing the GUI minimum 10 or edited to contain only 1 isn't significant. Pressing play on both of them will play a random movie. The "benefit" with a playlist only containing one movie is that you'll only be presented with one if you open the playlist.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Random movie</name>
    <match>all</match>
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>
    <limit>1</limit>
    <order direction="ascending">random</order>
</smartplaylist>


2 TV Shows

2.1 Last played TV shows

TV shows that've been played in the last 3 months ordered by last played with play count 0.

The play count setting makes it so if all episodes have been watched it doesn't show up, but as soon new unplayed episodes or seasons are scraped the TV Show will show up again in the playlist.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Last played TV shows</name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>3 months</value>
    </rule>
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>
    <order direction="descending">lastplayed</order>
</smartplaylist>


3 Episodes

3.1 In progress episodes

Episodes that are still in progress from the last 2 weeks ordered by last played.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>In progress episodes</name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>2 weeks</value>
    </rule>
    <rule field="inprogress" operator="true" />
    <order direction="descending">lastplayed</order>
</smartplaylist>


3.2 Last played episodes (history)

Not in progress episodes and with a play count bigger than 0 from the last 6 months ordered by last played.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>Last played episodes (history)</name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>6 months</value>
    </rule>
    <rule field="inprogress" operator="false" />
    <rule field="playcount" operator="greaterthan">
        <value>0</value>
    </rule>
    <order direction="descending">lastplayed</order>
</smartplaylist>


3.3 Random unplayed episodes from a TV show

10 random episodes with a play count of 0 from The Simpsons.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>Random episodes - The Simpsons</name>
    <match>all</match>
    <rule field="tvshow" operator="is">
        <value>The Simpsons</value>
    </rule>
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>
    <limit>10</limit>
    <order direction="ascending">random</order>
</smartplaylist>


3.4 Random unplayed episodes from several TV shows

10 random episodes with a play count of 0 (i.e. unplayed) from six different shows. Though as it's random this can create a list with two to ten episodes of the same show in a row.

If you specifically want to watch 6 random episodes from 6 different shows you could create playlists that are limited to 1 episode and 1 show (see One random movie example). Then you queue the 6 playlists.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>Random episodes - AAFFSS</name>
    <match>all</match>
    <rule field="tvshow" operator="is">
        <value>American Dad</value>
        <value>Archer</value>
        <value>Family Guy</value>
        <value>Futurama</value>
        <value>South Park</value>
        <value>The Simpsons</value>
    </rule>
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>
    <limit>10</limit>
    <order direction="ascending">random</order>
</smartplaylist>


3.5 TV show with specific episode names

A playlist with The Simpsons' Treehouse of Terror episodes.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>The Simpsons - Treehouse of Horror</name>
    <match>all</match>
    <rule field="title" operator="contains">
        <value>Treehouse</value>
    </rule>
    <rule field="tvshow" operator="is">
        <value>The Simpsons</value>
    </rule>
</smartplaylist>


4 Music Videos

5 Songs

5.1 Recently played songs

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
    <name>Recently Played Songs</name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>2 weeks</value>
    </rule>
    <order direction="descending">lastplayed</order>
</smartplaylist>


5.2 Rock music from the 1970s

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
    <name>Rock Music from the 1970s</name>
    <match>all</match>
    <rule field="genre" operator="is">
        <value>Rock</value>
    </rule>
    <rule field="year" operator="greaterthan">
        <value>1969</value>
    </rule>
    <rule field="year" operator="lessthan">
        <value>1980</value>
    </rule>
</smartplaylist>


5.3 Top 100 songs

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
    <name>Top 100 Songs</name>
    <match>all</match>
    <rule field="playcount" operator="greaterthan">
        <value>0</value>
    </rule>
    <order direction="descending">playcount</order>
    <limit>100</limit>
</smartplaylist>


6 Album

6.1 Albums By Label

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="albums">
    <name>DECCA</name>
    <match>all</match>
    <rule field="label" operator="is">
        <value>DECCA</value>
    </rule>
</smartplaylist>


7 Artists

Return to top