Kodi Community Forum

Full Version: conditional attrib...why don't work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Post some cut of my cod:

Settings: boolean (viewDirector, viewActors , viewFilmmakers)
Code:
<GetSettings dest="3">
<RegExp input="$$5" output="<settings>\1</settings>" dest="3">
<RegExp input="$$1" output="<setting label="Full Cast Credits" type="bool" id="fullcredits" default="true"></setting>" dest="5">
<expression/>
</RegExp>
<RegExp input="$$1" output="<setting label="Full Cast Credits > Get Director(s)" type="bool" id="viewDirector" default="true"></setting>" dest="5+">
<expression/>
</RegExp>
<RegExp input="$$1" output="<setting label="Full Cast Credits > Get Actors" type="bool" id="viewActors" default="true"></setting>" dest="5+">
<expression/>
</RegExp>
<RegExp input="$$1" output="<setting label="Full Cast Credits > Get Filmmakers" type="bool" id="viewFilmmakers" default="true"></setting>" dest="5+">
<expression/>
</RegExp>
<RegExp input="$$1" output="<setting label="Full Cast Credits > Cast Separeted by Fake Actor" type="bool" id="fakeactor" default="false"></setting>" dest="5+">
<expression/>
</RegExp>

Function to get FullCast (name, role and thumb)
Code:
<GetMovieFullCast clearbuffers="no" dest="5">
[INDENT]<RegExp input="$$2" output="<details>\1</details>" dest="5">
[INDENT]<!-- Director(s) -->
<RegExp conditional="viewDirector" input="$$3" output="\1" dest="2">
[INDENT]<!-- Fake Actor for Section delimiter: Regia -->
<RegExp conditional="fakeactor" output="<actor><name>.Regia</name></actor>" dest="3">
<expression noclean="1"/>
</RegExp>
<!-- Get Director(s) -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="3+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?r=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1" clear="yes"/>[/INDENT]
</RegExp>[/INDENT]
[INDENT]<!-- Actors -->
<RegExp conditional="viewActors" input="$$3" output="\1" dest="2">
[INDENT]<!-- Fake Actor for Section delimiter: Cast artistico -->
<RegExp conditional="fakeactor" output="<actor><name>.Cast artistico</name></actor>" dest="3+">
<expression noclean="1"/>
</RegExp>
<!-- Get Actors -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="3+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?a=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1" clear="yes"/>[/INDENT]
</RegExp>[/INDENT]
[INDENT]<!-- Filmmakers -->
<RegExp conditional="viewFilmmakers" input="$$3" output="\1" dest="2">
[INDENT]<!-- Fake Actor for Section delimiter: Filmmakers -->
<RegExp conditional="fakeactor" output="<actor><name>.Filmmakers</name></actor>" dest="3+">
<expression noclean="1"/>
</RegExp>
<!-- Get Filmmakers -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="3+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?s=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1" clear="yes"/>
</RegExp>
<expression noclean="1"/>[/INDENT]
</RegExp>[/INDENT][/INDENT]
</GetMovieFullCast>

The function GetMovieFullCast work well but don't respect conditional on bool setting.

With boolean viewDirector, viewActors, viewFilmmakers i would choose which type of cast appear in <actor> tag.

if i set:

viewDirector = 1, viewActors = 0, viewFilmmakers = 0 => ok!
viewDirector = 1, viewActors = 1, viewFilmmakers = 0 => ok!
viewDirector = 1, viewActors = 1, viewFilmmakers = 1 => ok!

but if i set:

viewDirector = 0, viewActors = 1, viewFilmmakers = 0 => view Directors and Actors
viewDirector = 0, viewActors = 1, viewFilmmakers = 1 => view Directors, Actors and Filmakers
viewDirector = 0, viewActors = 0, viewFilmmakers = 1 => view Directors, Actors and Filmakers

i don't find error...thanks in advance!

Ciao!

p.s with scrape editor work ok!
i have solved Big Grin...if someone is interested:
Code:
<GetMovieFullCast dest="5">
<RegExp input="$$2" output="<details>\1</details>" dest="5">
<!-- Director(s) -->
<RegExp conditional="viewDirector" input="$$3" output="\1" dest="2">
<!-- Fake Actor for Section delimiter: Regia -->
<RegExp conditional="fakeactor" output="<actor><name>.Regia</name></actor>" dest="3">
<expression noclean="1"/>
</RegExp>
<!-- Get Director(s) -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="3+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?r=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1"/>
</RegExp>
<!-- Actors -->
<RegExp conditional="viewActors" input="$$4" output="\1" dest="2+">
<!-- Fake Actor for Section delimiter: Cast artistico -->
<RegExp conditional="fakeactor" output="<actor><name>.Cast artistico</name></actor>" dest="4">
<expression noclean="1"/>
</RegExp>
<!-- Get Actors -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="4+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?a=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1"/>
</RegExp>
<!-- Filmmakers -->
<RegExp conditional="viewFilmmakers" input="$$5" output="\1" dest="2+">
<!-- Fake Actor for Section delimiter: Filmmakers -->
<RegExp conditional="fakeactor" output="<actor><name>.Filmmakers</name></actor>" dest="5">
<expression noclean="1"/>
</RegExp>
<!-- Get Filmmakers -->
<RegExp input="$$1" output="<actor><thumb>\1</thumb><name>\2</name><role>\3</role></actor>" dest="5+">
<expression repeat="yes" noclean="1">
src="([^"]+)" alt="([^"]+)" />[^d]+div[^"]+"[^<]+<[^"]+"http://www.mymovies.it/biografia/\?s=[0-9]+" title="\2">\2</a>[^>]+>([^<]+)</div>
</expression>
</RegExp>
<expression noclean="1"/>
</RegExp>
<expression noclean="1"/>
</RegExp>
</GetMovieFullCast>