Page 1 of 1

Broken "AND" operator handling in track selection parsing?

Posted: Sat Jan 06, 2018 3:36 pm
by yinleifu
I cannot figure out how to get the AND (&) operator to work in "app_DefaultSelectionString" in a Custom Profile. It seems to work when entered into the overriding "Default selection rule" field in the "Advanced" tab in the "MakeMKV Preferences" dialogue box. If I use an ampersand in a Custom Profile I get a an error message like:

"Profile parsing error: cprofile_02.mmcp.xml:18:58 - not well-formed (invalid token)"

which points squarely at the ampersand.

I have condensed it down to a simple example used in the answer to a question in the thread (see the very bottom):

http://www.makemkv.com/forum2/viewtopic ... 386#p17399

The string is:

"+sel:(forced&(!eng))"

And it works seemingly perfectly when entered into the "MakeMKV Preferences". It overrides the default setting and it correctly selects only forced subtitles that are not English, but when put in a Custom Profile it bombs, and the profile is not loaded.

Can somebody confirm if it's maybe just me messing things up, i.e. does the string work for others?

I am using Make MKV 1.10.8

/Michael

Re: Broken "AND" operator handling in track selection parsin

Posted: Sat Jan 06, 2018 3:48 pm
by Woodstock
The problem is that XML files consider & to be a reserved character. If you want one, you have to replace it with "&" (without the quotes).

Re: Broken "AND" operator handling in track selection parsin

Posted: Sat Jan 06, 2018 4:05 pm
by yinleifu
Brilliant! Works like a charm. Never actually worked with xml syntax myself, but I feel I should have figured this was the path anyway. The ampersand was shining bright red in the editor (who seems to know more about xml than I do) :-)

Thanks for the superfast reply, now my real selection string also works and by putting these selection strings in profiles I can switch between different selection schemes on the fly, depending on e.g. the original language of the file (always want audio in that).

"-sel:all,+sel:((favlang|nolang|single)&(subtitle&!forced)),+sel:(subtitle&eng),+sel:(audio),-sel:(havemulti|havelossless),+sel:(special),-sel:((!eng)&(!swe)),=100:all,-10:favlang"

The above selects the best audio track in either english or swedish and all subtitles in either english and swedish but no forced track for swedish (don't know why I put that in but well..). It works most of the time movies in English or my own language (swe).

/Michael