Kodi Community Forum

Full Version: Smart Playlists (Syntax)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know that default Smart Playlists have to match either "All" or "One", but that the playlist field can be used to combine several playlists together.

What I am trying to do is set up a Playlist that will
  • Look into 2 separate sources
  • Pick up any TV Shows that are EITHER "In Progress" OR "Playcount =0"
This is what have so far, but it is picking up extra items

Have I got the </rule> in the right place?
Is it something else?


Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Richard (Watching}</name>
    <match>all</match>
    <rule field="inprogress" operator="true"</rule>
    <rule field="playcount" operator="is"0</rule>
    <rule field="path" operator="contains">TV-SERIES</rule>
    <rule field="path" operator="contains">TV-RICHARD</rule>
</smartplaylist>
I don't think you can do that in one playlist, but happy to be corrected. The one you have won't work because to show up the path has to contain both 'TV-SERIES' and 'TV_RICHARD', which unless I've misunderstood are different folders - so your shows are in one or the other but not both.
(2017-10-14, 12:27)trogggy Wrote: [ -> ]I don't think you can do that in one playlist, but happy to be corrected.  The one you have won't work because to show up the path has to contain both 'TV-SERIES' and 'TV_RICHARD', which unless I've misunderstood are different folders - so your shows are in one or the other but not both.

The example on http://kodi.wiki/view/smart_playlists#Co..._playlists shows the same operator twice with different values for each.  Would the “Path” operator be any different?
Should have added - Section 4; Combining Playlists
You mean like this...?
Code:
 <match>all</match>
 <rule field="playlist" operator="is">Rock Music from the 1970s</rule>
 <rule field="playlist" operator="is">Recently Played Songs</rule>

You can have the same operator as many times as you like, but if you specify 'match all' and it doesn't match them all it won't show up.  In the wiki example, presumably only stuff that's in both playlists is returned.  Which is fine.  In your example only stuff that's in both folders is returned.  Which won't work.
Edit: from that wiki page:

Quote: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.
Looking at post #1 you'd need to do an OR (match 1) playlist for the first 2 conditions, an OR playlist for the last 2, then an AND (match all) to combine the 2 playlists.
(2017-10-14, 13:00)trogggy Wrote: [ -> ]You mean like this...?
Code:
 <match>all</match>
 <rule field="playlist" operator="is">Rock Music from the 1970s</rule>
 <rule field="playlist" operator="is">Recently Played Songs</rule>

You can have the same operator as many times as you like, but if you specify 'match all' and it doesn't match them all it won't show up.  In the wiki example, presumably only stuff that's in both playlists is returned.  Which is fine.  In your example only stuff that's in both folders is returned.  Which won't work.
Edit: from that wiki page:

Quote: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.
I realise now that I didn't understand how to use the "Playlist" operator. I was actually trying to combine the text contents of two different Playlists into one...

Thanks for advice - it made me think again. I'll go away and try the Playlist operator.
Good luck with it. Don't know if you saw my last edit to #5 (it was edited after you quoted) but that (the 3 playlists) should work.
(2017-10-14, 13:14)trogggy Wrote: [ -> ]Good luck with it.  Don't know if you saw my last edit to #5 (it was edited after you quoted) but that (the 3 playlists) should work.

Missed your post, and had to do it the hard way...
All working
Thanks
Thread moved to OS inf independent at it's not addon related
IIUC what is wanted is A AND B AND (C OR D).  The structure required I think is A AND B AND Playlist2 (all rules) where Playlist2 is C OR D (any rule).

scott s.
.