Release script.skinvariables - Construct skin variables and perform other skin functions
#76
Is this the correct way to have separate rules for library and plugins but for the same content?

json:
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["51", "53"],
"library": "53"
},
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["500", "501", "502", "503", "505", "506"],
"plugin": "503"
},

Because I'm getting the choice of the plugin view types for library content.

Thanks.
Reply
#77
(2024-05-09, 11:55)Hitcher Wrote: Is this the correct way to have separate rules for library and plugins but for the same content?

json:
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["51", "53"],
"library": "53"
},
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["500", "501", "502", "503", "505", "506"],
"plugin": "503"
},

Because I'm getting the choice of the plugin view types for library content.

Thanks.

I was under the impression it was a per rule match so:
json:
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["51", "53","500", "501", "502", "503", "505", "506"]
"library": "53"
"plugin": "503"
},

List the viewtypes per rule that matches the contentid= and specify if different for plugin or library.

I definitely do not know the code of the script so just going by the examples... Blush

You might be able to use a variable like mentioned earlier to create a contentid= to separate?

xml:
Runscript(script.skinvariables,action=buildviews,contentid=$VAR[SkinVariablesContentVar],pluginname=$INFO[Container.PluginName])

xml:

<variable name="SkinVariablesContentVar">
<value condition="String.IsEqual(Container.Content,tvshows) + !String.IsEmpty(Container.PluginName)">tvshows-plugin</value>
<value condition="!String.IsEmpty(Container.Content)">$INFO[Container.Content]</value>
</variable>

xml:
<value condition="String.IsEqual(Container.Content,tvshows) + !String.IsEmpty(Container.PluginName)">tvshows-plugin</value>
Or something like that...
json:
"tvshows": {
"rule": "Container.Content(tvshows)",
"viewtypes": ["51", "53"],
"library": "53"
},
"tvshows-plugin": {
"rule": "Container.Content(tvshows) + !String.IsEmpty(Container.PluginName)",
"viewtypes": ["500", "501", "502", "503", "505", "506"],
"plugin": "503"
},
Reply
#78
Yep variable like Mike's example above is how to separate the rules. Only change would be that you need to add the inverse to the tvshows "library" rule so it doesn't work with plugins.

i.e. "tvshows" library rule would be
"Container.Content(tvshows) + String.IsEmpty(Container.PluginName)"

and "tvshows-plugin" rule stays as:
"Container.Content(tvshows) + !String.IsEmpty(Container.PluginName)"
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#79
Thanks both of you.
Reply
#80
In case anyone else wants separate rules for library and plugins here's how I did it.

Run script command:

xml:
<onclick>Runscript(script.skinvariables,action=buildviews,contentid=$VAR[ContentID],pluginname=$INFO[Container.PluginName])</onclick>

ContentID variable:

xml:
<variable name="ContentID">
<value condition="!String.IsEmpty(Container.PluginName) + String.IsEmpty(Container.Content)">plugins_none</value>
<value condition="!String.IsEmpty(Container.PluginName)">$INFO[Container.Content,plugins_]</value>
<value condition="!String.IsEmpty(Container.Content)">$INFO[Container.Content]</value>
<value condition="String.IsEmpty(Container.Content)">none</value>
</variable>

skinviewtypes.json:

json:
{
"prefix": "Exp_View",
"viewtypes": {
"50": "31161",
"51": "31130",
"52": "31111",
"53": "31160",
"54": "31112",
"55": "31159",
"56": "31203"
},
"rules": {
"images": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(images)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"videos": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(videos)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "50"
},
"movies": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(movies)",
"viewtypes": ["53"],
"library": "53"
},
"sets": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(sets)",
"viewtypes": ["53"],
"library": "53"
},
"videoversions": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(videoversions)",
"viewtypes": ["50"],
"library": "50"
},
"tvshows": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(tvshows)",
"viewtypes": ["51", "53"],
"library": "53"
},
"seasons": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(seasons)",
"viewtypes": ["51", "53"],
"library": "53"
},
"episodes": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(episodes)",
"viewtypes": ["52"],
"library": "52"
},
"genres": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(genres)",
"viewtypes": ["50"],
"library": "50"
},
"years": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(years)",
"viewtypes": ["50"],
"library": "50"
},
"studios": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(studios)",
"viewtypes": ["50"],
"library": "50"
},
"directors": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(directors)",
"viewtypes": ["50"],
"library": "50"
},
"countries": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(countries)",
"viewtypes": ["50"],
"library": "50"
},
"tags": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(tags)",
"viewtypes": ["50"],
"library": "50"
},
"roles": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(roles)",
"viewtypes": ["50"],
"library": "50"
},
"actors": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(actors)",
"viewtypes": ["50"],
"library": "50"
},
"playlists": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(playlists)",
"viewtypes": ["50"],
"library": "50"
},
"games": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(games)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"musicvideos": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(musicvideos)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"artists": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(artists)",
"viewtypes": ["50"],
"library": "50"
},
"albums": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(albums)",
"viewtypes": ["50"],
"library": "50"
},
"songs": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(songs)",
"viewtypes": ["54", "50"],
"library": "54"
},
"files": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(files)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "50"
},
"sources": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(sources)",
"viewtypes": ["50"],
"library": "50"
},
"addons": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content(addons)",
"viewtypes": ["50"],
"library": "50"
},
"none": {
"rule": "String.IsEmpty(Container.PluginName) + Container.Content()",
"viewtypes": ["50"],
"library": "50"
},
"plugins_images": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(images)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"plugins_videos": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(videos)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "50"
},
"plugins_movies": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(movies)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "53"
},
"plugins_sets": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(sets)",
"viewtypes": ["53"],
"library": "53"
},
"plugins_videoversions": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(videoversions)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_tvshows": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(tvshows)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "53"
},
"plugins_seasons": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(seasons)",
"viewtypes": ["51", "53"],
"library": "53"
},
"plugins_episodes": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(episodes)",
"viewtypes": ["52"],
"library": "52"
},
"plugins_genres": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(genres)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_years": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(years)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_studios": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(studios)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_directors": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(directors)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_countries": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(countries)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_tags": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(tags)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_roles": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(roles)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_actors": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(actors)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_playlists": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(playlists)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_games": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(games)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"plugins_musicvideos": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(musicvideos)",
"viewtypes": ["50", "53", "55"],
"library": "50"
},
"plugins_artists": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(artists)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_albums": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(albums)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_songs": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(songs)",
"viewtypes": ["54", "50"],
"library": "54"
},
"plugins_files": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(files)",
"viewtypes": ["50", "51", "52", "53", "55", "56"],
"library": "50"
},
"plugins_sources": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(sources)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_addons": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content(addons)",
"viewtypes": ["50"],
"library": "50"
},
"plugins_none": {
"rule": "!String.IsEmpty(Container.PluginName) + Container.Content()",
"viewtypes": ["50"],
"library": "50"
}

}
}
Reply
#81
@jurialmunkey,

sorry late to this party but trying to move my skin along again and am looking for a replacement for embuary helper script.

would you please consider adding a replacement for this particular helper?

plugin://script.embuary.helper/?info=jumptoletter&showall=false&reload=$INFO[Container.NumItems]


Wyrm
Reply
#82
(2024-05-12, 16:37)wyrm Wrote: would you please consider adding a replacement for this particular helper?

plugin://script.embuary.helper/?info=jumptoletter&showall=false&reload=$INFO[Container.NumItems]

You can actually do an alphabet scroll natively in skin engine without needing a plugin by using a hidden button to control scroll by letter and a strip of letters checking ListItem.SortLetter

It's a slightly different experience because you scroll left/right rather than move to button then click, but honestly I find this approach much nicer generally because you can see the change in real time and it is much smoother than waiting on a script to fire.

xml:

<!-- Hidden button to control scroll -->
<control type="button" id="9000">
<texturenofocus />
<texturefocus />
<font />
<onleft>SetFocus(50)</onleft>
<onleft>Action(prevletter)</onleft>
<onleft>SetFocus(9000)</onleft>
<onright>SetFocus(50)</onright>
<onright>Action(nextletter)</onright>
<onright>SetFocus(9000)</onright>
</control>

<!-- Letter label include for alphabet strip -->
<include name="Object_AlphabetLetter">
<control type="label">
<textcolor>unfocused_color</textcolor>
<label>$PARAM[letter]</label>
<visible>!String.IsEqual(ListItem.SortLetter,$PARAM[letter])</visible>
<width>20</width>
</control>
<control type="label">
<textcolor>focused_color</textcolor>
<label>$PARAM[letter]</label>
<visible>String.IsEqual(ListItem.SortLetter,$PARAM[letter])</visible>
<width>20</width>
</control>
</include>

<!-- Alphabet display strip -->
<control type="grouplist">
<orientation>horizontal</orientation>
<include content="Object_AlphabetLetter"><param name="letter">A</param></include>
<include content="Object_AlphabetLetter"><param name="letter">B</param></include>
<include content="Object_AlphabetLetter"><param name="letter">C</param></include>
<include content="Object_AlphabetLetter"><param name="letter">D</param></include>
<include content="Object_AlphabetLetter"><param name="letter">E</param></include>
<include content="Object_AlphabetLetter"><param name="letter">F</param></include>
<include content="Object_AlphabetLetter"><param name="letter">G</param></include>
<include content="Object_AlphabetLetter"><param name="letter">H</param></include>
<include content="Object_AlphabetLetter"><param name="letter">I</param></include>
<include content="Object_AlphabetLetter"><param name="letter">J</param></include>
<include content="Object_AlphabetLetter"><param name="letter">K</param></include>
<include content="Object_AlphabetLetter"><param name="letter">L</param></include>
<include content="Object_AlphabetLetter"><param name="letter">M</param></include>
<include content="Object_AlphabetLetter"><param name="letter">N</param></include>
<include content="Object_AlphabetLetter"><param name="letter">O</param></include>
<include content="Object_AlphabetLetter"><param name="letter">P</param></include>
<include content="Object_AlphabetLetter"><param name="letter">Q</param></include>
<include content="Object_AlphabetLetter"><param name="letter">R</param></include>
<include content="Object_AlphabetLetter"><param name="letter">S</param></include>
<include content="Object_AlphabetLetter"><param name="letter">T</param></include>
<include content="Object_AlphabetLetter"><param name="letter">U</param></include>
<include content="Object_AlphabetLetter"><param name="letter">V</param></include>
<include content="Object_AlphabetLetter"><param name="letter">W</param></include>
<include content="Object_AlphabetLetter"><param name="letter">X</param></include>
<include content="Object_AlphabetLetter"><param name="letter">Y</param></include>
<include content="Object_AlphabetLetter"><param name="letter">Z</param></include>
</control>

Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#83
Jurialmunkey,

mate that solution is gold.  Always prefer to use the skin engine when I can as it is generally quicker and I am not dependent on a external script (which like the last two scripts I had to use and then became unsupported).  I was always led to believe that it was just not possible to do this with the skin engine, so a huge thumbs up to you for showing others how it is done.

Now off to work this into my skin.
Wyrm
Reply

Logout Mark Read Team Forum Stats Members Help
script.skinvariables - Construct skin variables and perform other skin functions0