Kodi Community Forum

Full Version: How to create smart playlist for this use case?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want a "lazy sunday morning" playlist that displays one random episode per added TV show.

I've created a "base playlist" for each show limiting it to one random episode and then one "final playlist" to merge them all.

example base playlist:

xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
<name>The Simpsons</name>
<match>all</match>
<rule field="tvshow" operator="is">
<value>The Simpsons</value>
</rule>
<rule field="rating" operator="greaterthan">
<value>7</value>
</rule>
<limit>1</limit>
<order direction="ascending">random</order>
</smartplaylist>

final playlist:

xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
<name>Random cartoons</name>
<match>one</match>
<rule field="playlist" operator="is">
<value>The Simpsons</value>
</rule>
<rule field="playlist" operator="is">
<value>Family Guy</value>
</rule>
<rule field="playlist" operator="is">
<value>American Dad!</value>
</rule>
<rule field="playlist" operator="is">
<value>Futurama</value>
</rule>
<rule field="playlist" operator="is">
<value>South Park</value>
</rule>
<rule field="playlist" operator="is">
<value>Rick and Morty</value>
</rule>
<rule field="playlist" operator="is">
<value>One Piece</value>
</rule>
<limit>10</limit>
<order direction="ascending">rating</order>
</smartplaylist>

Unfortunately, the result contains multiple episodes of each show and I don't understand why.

Can anyone help me here? Is there a more sophisticated syntax I can look up in some documentation or are there direct db requests possible within these playlists?
Not 100% sure, but I think the Limit rule only acts on the "final playlist".