Thread Rating:
  • 1 Vote(s) - 5 Average
[Help] Smart Playlist rules don't work
#1
Question 
Hello everyone!

I need a smart playlist that shows only films greater than or equal to 120 min. XBMC with the code below shows all the movies over 2 hours, but is also showing all the movies less than 1 hour e 40 minutes.

Code:
<? Xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
  <smartplaylist type="movies">
   <name> Greater than or equal to 120 min </ name>
   <match> one </ match>
   <rule field="time" operator="greaterthan"> 119 </ rule>
   <rule field="time" operator="is"> 120 </ rule>
   <order direction="ascending"> time </ order>
  </ smartplaylist>

I'm using XBMC Pre-11 (Git-20110902-64DBB08) with Confluence.

What am I doing wrong?

Thanks in advance to anyone who can help.

PASTBIN
Reply
#2
Is time the right field? I thought XBMC used duration or some such thing. When Ember makes nfos for my movies, the duration is always set in seconds.
Image
Reply
#3
clubwerks Wrote:Is time the right field? I thought XBMC used duration or some such thing. When Ember makes nfos for my movies, the duration is always set in seconds.

Yes! The only rule field that allows me to filter by duration is the "time".

I'm using the version of Ember from that link and for me the nfos files are created in the form of minutes. But do not think that's the problem, as I have created smart playlist that work perfectly, as the code below:

] <? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
<smartplaylist type="movies">
<name> Less than or equal to 100 min </ name>
<match> one </ match>
<rule field="time" operator="greaterthan"> 00:45 </ rule>
<rule field="time" operator="lessthan"> 01:40 </ rule>
<rule field="time" operator="is"> 01:40 </ rule>
<order direction="ascending"> time </ order>
</ smartplaylist>

Do you have another suggestion?

By the way, thanks for the help.
Reply
#4
the smart playlist looks fine. But I've just tried to do similar and also get a bunch of movies that do not fit the criteria. It also isn't sorted correctly.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>duration</name>
    <match>all</match>
    <rule field="time" operator="greaterthan">149</rule>
    <order direction="ascending">time</order>
</smartplaylist>

If I change the duration to seconds - something like
Code:
<rule field="time" operator="greaterthan">12000</rule>
it actually gives more results than the first playlist, but if I decease 12000 to 10000 it gives less results.

Also tried changing to
Code:
<rule field="time" operator="greaterthan">149 min</rule>
and this gives a low number of results but nothing that is correct.

EDIT: Also tried changing the filed to durationinseconds as per the nfo files - nothing either
Using Dharma with Transparency

Its got me stumped
Openelec on ASRock ION 330 / Kodi on Win 7 PC
Reply
#5
Smart playlist expects hours and minutes so you want 02:00 for 120 min seems obvious but its easy to get mixed up Smile

If you want to show movies equal and above 120 min the below seems to work however I didn't go through my whole movie collection and it does list those equal to 120

I've done it up to 3 hours (180 min) so if you have any movies over the 3 hour mark your need to change that value

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Greater than or equal to 120 min</name>
    <match>all</match>
    <rule field="time" operator="greaterthan">01:59</rule>
    <rule field="time" operator="lessthan">03:00</rule>
</smartplaylist>

If you wanted a playlist for everything below 120 min you can use a playlist that works off the playlist above

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Less Than 120 min</name>
    <match>all</match>
    <rule field="playlist" operator="isnot">Greater than or equal to 120 min</rule>
</smartplaylist>
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#6
Cool!
Image
Reply
#7
>>X<< Wrote:Smart playlist expects hours and minutes so you want 02:00 for 120 min seems obvious but its easy to get mixed up Smile

If you want to show movies equal and above 120 min the below seems to work ...

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>Greater than or equal to 120 min</name>
    <match>[b]all[/b]</match>
    <rule field="time" operator="greaterthan">01:59</rule>
    <rule field="time" operator="lessthan">03:00</rule>
</smartplaylist>

I used the code you suggested and it worked! Big Grin

I created several other smart playlists based on your model and all worked. Big Grin

I found some things about playlists that also helped a lot:

Quote:<match> tag indicates how the <rule> tags should be matched.

If <match>all</match> then only songs which satisfy all the <rule>'s will be included.

If <match>one</match> is specified, then songs that satisfy any one (or more) of the <rule>'s will be included.
Thanks to everyone who responded and tried to help.
Reply
#8
Forgot to mention you can set the playlist order to duration as well if you haven't noticed already either descending or ascending longest first to shortest last or vice versa

Glad it worked for you Smile
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#9
>>X<< Wrote:Forgot to mention you can set the playlist order to duration as well if you haven't noticed already either descending or ascending longest first to shortest last or vice versa

Glad it worked for you

I'm already using the order direction in my Smart Playlist. See:

<? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
<smartplaylist type="movies">
<name> 2h01min to 2h15min </ name>
<match>all</ match>
<rule field="time" operator="greaterthan"> 02:00 </ rule>
<rule field="time" operator="lessthan"> 02:16 </ rule>
<order direction="ascending"> time </ order>
</ smartplaylist>

Thanks again.
Reply
#10
Think I need to get down the opticians its in the first post as well Rolleyes
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#11
Something is still wrong!

After using <order direction="ascending">time</order> in my smart playlists, the films lasting less than 100 minutes are shown after the movies longer than 100 minutes.

For example, the list starts with 100, 101, 102 ... 105, but should start with 91. The worst part is that only after the last film in the hundred (105 minutes) films less than 100 minutes to appear (91, 92, 93 ... 99).

What am I doing wrong now?:

Code:
<? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
   <smartplaylist type="movies">
         <name> 1h31min to 1h45min </ name>
         <match> one </ match>
         <rule field="time" operator="greaterthan"> 01:30 </ rule>
         <rule field="time" operator="lessthan"> 01:46 </ rule>
        <order direction="[b]ascending[/b]"> time </ order>
   </ smartplaylist>
Thanks in advance.
Reply
#12
In your above playlist you have

<match>one</ match>

It needs to be the below for it to work

<match>all</ match>
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#13
If I use <match> all </ match> nothing shows up (the smart playlist is empty.)

Any other suggestions?
Reply
#14
Yeah there's something strange going on there unless I'm missing something just editing a working playlist to use greater than 01:30 that's working and set to "all" stops it working

It works if you use "one" but seems to order each list/rule separately which is why you get the ordering in your previous post

Using match one isn't any good anyway as your get everything above and below the times you choose

Sorry to say I don't have the answer to this one Confused
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#15
>>X<< Wrote:Yeah there's something strange going on there unless I'm missing something just editing a working playlist to use greater than 01:30 that's working and set to "all" stops it working
Exactly!

>>X<< Wrote:It works if you use "one" but seems to order each list/rule separately which is why you get the ordering in your previous post

Using match one isn't any good anyway as your get everything above and below the times you choose

Sorry to say I don't have the answer to this one Confused

I think that is a bug, right?

Any way, thanks for your help.
Reply



[Help] Smart Playlist rules don't work51