2020-04-22, 16:20
Hi. My household has several people and I recently dumped using kodi's built-in favorites for using tags + smart playlists instead. It makes it far easier to maintain everyone's own `favorites` lists, what shows we watch together, etc. The bug is in the "is" operator behavior. By definition, the relevant operators are:
contains: True if the field contains the parameter as a substring
doesnotcontain: True if the field does not contain the parameter as a substring
is: True if the field matches the parameter exactly
isnot: True if the field does not match the parameter exactly
Say I have a tv show called "SomeShow" and I add my favorite tag "fav-me" to it. Then in a smart playlist to list only shows I watch, I add the rule:
<rule field="tag" operator="is"><value>fav-me</value></rule>
When I run the xsp, the result is SomeShow as expected. The value is exactly "fav-me". Let's say I then add another favorite tag, "fav-you", to SomeShow so now SomeShow has 2 tags; fav-me, fav-you. If I run the xsp again, I still get SomeShow as a result even though the tag field is not exactly just "fav-me". If I look at the tags in the webif, it shows "fav-me; fav-you". Since "is" is supposed to be true only when the value matches exactly, it should not be triggered when the value does not match exactly.
Because of this broken "is" behavior, to single out tv shows only the "fav-me" tag watches, you have to manually exclude every other favorite tag out as a workaround. Something like this:
<rule field="tag" operator="contains"><value>fav-me</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-you</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid1</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid2</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid3</value></rule>
And then you'd have to do that for each different person where you should only need a single "is" rule.
contains: True if the field contains the parameter as a substring
doesnotcontain: True if the field does not contain the parameter as a substring
is: True if the field matches the parameter exactly
isnot: True if the field does not match the parameter exactly
Say I have a tv show called "SomeShow" and I add my favorite tag "fav-me" to it. Then in a smart playlist to list only shows I watch, I add the rule:
<rule field="tag" operator="is"><value>fav-me</value></rule>
When I run the xsp, the result is SomeShow as expected. The value is exactly "fav-me". Let's say I then add another favorite tag, "fav-you", to SomeShow so now SomeShow has 2 tags; fav-me, fav-you. If I run the xsp again, I still get SomeShow as a result even though the tag field is not exactly just "fav-me". If I look at the tags in the webif, it shows "fav-me; fav-you". Since "is" is supposed to be true only when the value matches exactly, it should not be triggered when the value does not match exactly.
Because of this broken "is" behavior, to single out tv shows only the "fav-me" tag watches, you have to manually exclude every other favorite tag out as a workaround. Something like this:
<rule field="tag" operator="contains"><value>fav-me</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-you</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid1</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid2</value></rule>
<rule field="tag" operator="doesnotcontain"><value>fav-kid3</value></rule>
And then you'd have to do that for each different person where you should only need a single "is" rule.