Kodi Community Forum

Full Version: Smart Playlist Logic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm trying to use smart playlists to separate my movies into shorts (anything shorter than 40mins) and features (anything 40mins or longer), and I can't figure out how to combine AND and OR conditions. For example, I want to create a playlist of all unwatched features which would require the rule

xml:
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>

and one of the following rules:

xml:
    <rule field="time" operator="greaterthan">

        <value>40:00</value>

    </rule>
or
xml:
    <rule field="time" operator="is">

        <value>40:00</value>

    </rule>

Unfortunately I only seem able to match=all or match=one of the rules. The closest hack I can come up with is using a rule with time greaterthan 39:59 and hoping nothing falls into the 1 second gap. If anyone has a better way of achieving this I'd be happy to hear.
https://kodi.wiki/view/Smart_playlists#C..._playlists
Quote:Using this system allows very complex queries to be built. Note that in a single playlist, you can only match ALL of the rules, or ONE (or more) of the rules. This is basically either ANDing the conditions together, or ORing them together. You cannot mix AND with OR in a single playlist. To build up a playlist with both AND and OR operations on the rules, you use multiple playlists to group the AND operations and the OR operations, then combine them as above.
Thank you! That worked beautifully.

xml:
<smartplaylist type="movies">
    <name>Unwatched features</name>
    <match>all</match>
    <rule field="playlist" operator="is">
        <value>Features</value>
    </rule>
    <rule field="playcount" operator="is">
        <value>0</value>
    </rule>
    <limit>15</limit>
    <order direction="descending">random</order>
</smartplaylist>