Kodi Community Forum

Full Version: Aeon MQ5 - MPAA comparison for UK w/o substring?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

An user of our mediamanager had the following issue, that the MPAA certification for UK is not displayed.
In our NFO we can have multiple certifications like "UK:15 / GB:15 / DE:FSK16".

I checked the IncludesVariables.xml, and for every language you do a substring search EXCEPT FOR UK!
Is this on purpose?
Or could you change that to substring search as well?

<value condition="StringCompare(ListItem.Mpaa,UK:15)">flags/mpaa/BBFC_15_Certificate_UK.png</value>
vs
<value condition="SubString(ListItem.Mpaa,TV-14)">flags/mpaa/TV-14_Certificate_US.png</value>

brgds

PS
great skin, btw Smile
This is necessary to avoid which is shown wrong flag, but is applicable only in this case, I think:

<value condition="StringCompare(ListItem.Mpaa,UK:12)">flags/mpaa/BBFC_12_Certificate_UK.png</value>
<value condition="StringCompare(ListItem.Mpaa,UK:12A)">flags/mpaa/BBFC_12A_Certificate_UK.png</value>

If you use SubString the skin will show the first flag for both conditions.
ok, is the "UK:12" the only "duplicate"?
Could you change all the others to use substring?! (including 12a)
should have no impact....?

maybe use both (if possible);
<value condition="StringCompare(ListItem.Mpaa,UK:12)">flags/mpaa/BBFC_12_Certificate_UK.png</value>
<value condition="SubString(ListItem.Mpaa,UK:12 )">flags/mpaa/BBFC_12_Certificate_UK.png</value>
(Note the space!)
And yes, wont work in every case, but... Smile
(2013-11-28, 20:31)MarcosQui Wrote: [ -> ]This is necessary to avoid which is shown wrong flag, but is applicable only in this case, I think:

<value condition="StringCompare(ListItem.Mpaa,UK:12)">flags/mpaa/BBFC_12_Certificate_UK.png</value>
<value condition="StringCompare(ListItem.Mpaa,UK:12A)">flags/mpaa/BBFC_12A_Certificate_UK.png</value>

If you use SubString the skin will show the first flag for both conditions.

Variables stop when the first condition is met, so if you do a substring on UK:12A first and then on UK:12 it will work correctly.

nvm thats only correct in half the cases, this should work though:
Code:
<value condition="SubString(ListItem.mpaa,UK:12) + !SubString(ListItem.mpaa,UK:12A)">BBFC_12_Certificate_UK</value>
<value condition="SubString(ListItem.mpaa,UK:12A)">BBFC_12A_Certificate_UK</value>
Yes, that's correct. I'll make the necessary changes.
Great Smile
Thank you both.