INTERACT FORUM

More => Old Versions => Media Center 13 (Development Ended) => Topic started by: steveklein on February 05, 2009, 07:18:16 pm

Title: any way to create this filter?
Post by: steveklein on February 05, 2009, 07:18:16 pm
i want to create a filter that searches various fields and checks to see if the number of open parenthesees ( matches up with closed parenthesees )

i think this would help me identify files that are truncated
Title: Re: any way to create this filter?
Post by: steveklein on February 08, 2009, 11:07:22 am
anyone got an idea?
Title: Re: any way to create this filter?
Post by: mark_h on February 08, 2009, 01:14:21 pm
I don't think this is currently possible.  As good as smartlists are you'd need something like regular expressions to do this and MC doesn't support them.

Cheers,

Mark
Title: Re: any way to create this filter?
Post by: marko on February 08, 2009, 03:15:08 pm
I tried to get you there using listcount (http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language#ListCount.28....29:_Use_to_return_the_number_of_items_in_a_delimited_list).
The idea being that you create two calculated fields, one that counts opening, and one that counts closing parenthesis, then compare the two for equality using an isequal() expression.

While the theory is excellent, the practice is not.
This is because the listcount function is counting items against a given delimiter, (in this case, the parenthesis) not the delimiter itself, therefore, any closing bracket at the end of a given field is not counted, rendering the idea a bit of a cul-de-sac.

I wonder if it would work if you created a smartlist that lists all artists that contain an opening, another that lists all artists that contain a closing, and a third that lists tracks that are in the first list, but not the second?

-marko.
Title: Re: any way to create this filter?
Post by: gappie on February 08, 2009, 03:24:45 pm
nice, marco i was thinking the same and this is what i came up with .
if(IsEqual(ListCount([name]WE,/(),ListCount([name]WE,/)),2),good,bad)
by putting the WE after the name it seems to work.

 :)
gab
Title: Re: any way to create this filter?
Post by: mark_h on February 08, 2009, 04:03:21 pm
Nice!

Mark
Title: Re: any way to create this filter?
Post by: marko on February 09, 2009, 01:22:21 am
Works as expected in a view scheme pane, but appears to be yet another example of the smartlist wizard mis-interpreting the string because, if you use:

[=IsEqual(ListCount([name]WE,/(),ListCount [name]WE,/)),2 ]=0

as a smartlist rule, the wizard changes it to:

[=IsEqual(ListCount([name]WE,/,ListCount [name]WE,/)),2 ]=0

stripping out the "()" when I press the OK button, leaving the escape character as the delimiter, and removing the parenthesis that closes the first listcount function ?

-marko.
Title: Re: any way to create this filter?
Post by: gappie on February 09, 2009, 02:50:01 am
"never trust a Wizard"