Kodi Community Forum
Release Embuary Helper Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Skins Support (https://forum.kodi.tv/forumdisplay.php?fid=67)
+---- Forum: Embuary (https://forum.kodi.tv/forumdisplay.php?fid=297)
+---- Thread: Release Embuary Helper Script (/showthread.php?tid=345318)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


RE: script.embuary.helper - chrissix666 - 2019-07-11

(2019-07-11, 08:40)sualfred Wrote: usage in dialog video info:
working also for Krypton ported EmbuaryHelper?


RE: script.embuary.helper - sualfred - 2019-07-11

I can backport this function if required.

Edit:
Leia: https://github.com/sualfred/script.embuary.helper/commit/fa469207f4b3f1f4ab84776924b2f27edcad5a4f
Krypton: https://github.com/sualfred/script.embuary.helper/commit/28e58968374cfa75a742e9561daad814385c73e8


RE: script.embuary.helper - chrissix666 - 2019-07-11

(2019-07-11, 08:50)sualfred Wrote: I can backport this function if required.
Only if the necessary time and motivation is available.  Rofl
Then i would stay several days in my computer room experimenting with it *gg*


RE: script.embuary.helper - sualfred - 2019-07-11

Cherrypicking is done within seconds. Already did.


RE: script.embuary.helper - chrissix666 - 2019-07-11

i now tried for testing this code:
Code:
            <control type="multiimage" id="98767">
                <left>520</left>
                <top>150</top>
                <height>550</height>
                <width>550</width>
                <timeperimage>6000</timeperimage>
                <randomize>false</randomize>    
                <fadetime>1000</fadetime>
                <aspectratio aligny="bottom">keep</aspectratio>            
                <imagepath background="true">$INFO[Window(home).Property(genre.1).ListItem.Label,resource://resource.images.moviecountryicons.flags/,.png]</imagepath>            
                <visible>Container.Content(movies)</visible>    
            </control>

I see multiimage, but it's showing all in the resource addon, not only "genre.1" ... Something wrong with my syntax?


RE: script.embuary.helper - sualfred - 2019-07-11

Totally wrong usage. 

Code:

<control type="list">
        <itemlayout>
             <control type="image">
                    <texture>$INFO[ListItem.Label,resource://resource.images.moviecountryicons.flags/,.png]</texture>
             </control>
       </itemlayout>
        <focusedlayout>
             <control type="image">
                    <texture>$INFO[ListItem.Label,resource://resource.images.moviecountryicons.flags/,.png]</texture>
             </control>
       </focusedlayout>
        <content>
            <item>
                <label>$INFO[Window(home).Property(genre.0)]</label>
                <visible>!String.IsEmpty(Window(home).Property(genre.0))</visible>
            </item>
            <item>
                <label>$INFO[Window(home).Property(genre.1)]</label>
                <visible>!String.IsEmpty(Window(home).Property(genre.1))</visible>
            </item>
            <item>
                <label>$INFO[Window(home).Property(genre.2)]</label>
                <visible>!String.IsEmpty(Window(home).Property(genre.2))</visible>
            </item>

.....
....

        </content>
</control>



RE: script.embuary.helper - sualfred - 2019-07-11

Or use a common image control without a list container. Also possible in grouplists.

Code:

...
             <control type="image">
                    <texture>$INFO[Window(home).Property(genre.1),resource://resource.images.moviecountryicons.flags/,.png]</texture>
             </control>
             <control type="image">
                    <texture>$INFO[Window(home).Property(genre.2),resource://resource.images.moviecountryicons.flags/,.png]</texture>
             </control>

....



RE: script.embuary.helper - manfeed - 2019-07-11

(2019-07-11, 08:40)sualfred Wrote: https://github.com/sualfred/script.embuary.helper/commit/a50383c1d8573e69cd0bc4856bcfc8a63e466ba5

usage in dialog video info:

Code:

<onload>runscript(script.embuary.helper,action=split,property=genre,separator='" / "',value='$ESCINFO[ListItem.Genre]')</onload>
<onload>runscript(script.embuary.helper,action=split,property=studio,separator='" / "',value='$ESCINFO[ListItem.Studio]')</onload>
<onload>runscript(script.embuary.helper,action=split,property=country,separator='" / "',value='$ESCINFO[ListItem.Country]')</onload>
... and what ever floats your boat ...

Results in 
Code:

$INFO[Window(home).Property(genre.0)]
$INFO[Window(home).Property(genre.1)]
... etc etc ..

Great! Please, would it be possible anything like this for video views? If only for the focused item... Thanks!


RE: script.embuary.helper - sualfred - 2019-07-11

@manfeed 
https://github.com/sualfred/script.embuary.helper/commit/441c2bb254b46b3543fce5820fd91c141689c090

Untested and should be expensive on slower systems. And you also can expect a slightly delay on refreshing of these values:

To activate add this to your home/startup xml:
Code:

<onload condition="!Skin.HasSetting(FocusMonitor)">Skin.ToggleSetting(FocusMonitor)</onload>

After that you should get ( %i = 0,1,2,3,4,etc):
  • $INFO[Window(home).Property(ListItem.Genre.%i)]
  • $INFO[Window(home).Property(ListItem.Studio.%i)]
  • $INFO[Window(home).Property(ListItem.Country.%i)]
  • $INFO[Window(home).Property(ListItem.Director,%i)]

Edit:
Seems to work fine. Also backported it to Krypton on GitHub

Edit2:
Pushed it to my repo


RE: script.embuary.helper - sualfred - 2019-07-12

@"chrissix" @manfeed 
Does it work?


RE: Embuary (Krypton + Leia) - manfeed - 2019-07-12

@sualfred

Thank you very much, it works faultlessly! However, you were right when you said...
(2019-07-11, 06:20)sualfred Wrote: But I'm not a fan to add a "focus monitor" to support this for all windows and listings. It's expensive and it's one of the things that made the skin helper service so slow. And it's always slightly delayed and only working for the focused item. 

Sadly, I found that to be true, so I'm still unsure about how to use it, since that slowness was the reason I removed support for skin helper service in my skin.

However, I noticed that the cast option provided with...

plugin://script.embuary.helper?info=getcast&amp;type=movie&amp

...doesn't seem to suffer from the same slowness, even though it seems to provide more complex data... Huh

Thanks again!


RE: script.embuary.helper - sualfred - 2019-07-12

Because it's called directly.

The service monitor is a ongoing endless loop with a sleep of 1s between. Each seond ListItem.Genre (for example) is grabbed and processed to multiple splitted strings in a window prop. So you have a mix of multiple delays:

- the monitor sleep, which is required (1s)
- the xbmc.getInfoLabel call (takes milliseconds)
- the splitting function (takes milliseconds)
- the setting of the window prop (takes milleseconds)

So you have a possible valid result after ~1, maximum 2, seconds.

Edit:
And nevertheless, the Python overhead Wink


RE: script.embuary.helper - sualfred - 2019-07-12

@manfeed 

I've added something that possible can be used for a "skin hack". (https://github.com/sualfred/script.embuary.helper/commit/2bf120225e9de6276a1f2aedf830871adba50b07)

Add a hidden list container with this path
xml:

<content>plugin://script.embuary.helper/?info=bydbid&amp;dbid=$INFO[ListItem.DBID]&amp;type=$INFO[ListItem.DBType]</content>

And then use (example):

xml:

$INFO[Container(2121).ListItem.Property(Genre.0)]

Should work fine for movies, tvshows, episodes, but not for seasons or any other item type.


RE: script.embuary.helper - manfeed - 2019-07-12

I love "skins hacks"... Rofl

Thanks! It seems to work much better, at least with the same performance that the cast option... Nod

However, a couple of times I got a error message, and not always with the same movie, I mean, a movie that works ok sometimes gives errors but sometimes not... Huh

The log says...

xml:
2019-07-12 11:22:23.652 T:3288   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'PluginContent' object has no attribute 'method_details'
                                            Traceback (most recent call last):
                                              File "C:\Leia2\portable_data\addons\script.embuary.helper\plugin.py", line 97, in <module>
                                                Main()
                                              File "C:\Leia2\portable_data\addons\script.embuary.helper\plugin.py", line 27, in __init__
                                                self.getinfos()
                                              File "C:\Leia2\portable_data\addons\script.embuary.helper\plugin.py", line 83, in getinfos
                                                plugin.get_bydbid()
                                              File "C:\Leia2\portable_data\addons\script.embuary.helper\resources\lib\plugin_content.py", line 65, in get_bydbid
                                                json_query = json_call(self.method_details,
                                            AttributeError: 'PluginContent' object has no attribute 'method_details'
                                            -->End of Python script error report<--
2019-07-12 11:22:23.701 T:3960   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://script.embuary.helper/?info=bydbid&dbid=&type=

Thanks again!


RE: script.embuary.helper - sualfred - 2019-07-12

ListItem.DBID + ListItem.DBType is empty. These items have to be available. 

use a variable:
xml:

<variable name="getDBIDcontent">
<value condition="!String.IsEmpty(ListItem.DBID) + [String.IsEqual(ListItem.DBType,movie) | String.IsEqual(ListItem.DBType,tvshow) | String.IsEqual(ListItem.DBType,episode)]">plugin://script.embuary.helper/?info=bydbid&amp;dbid=$INFO[ListItem.DBID]&amp;type=$INFO[ListItem.DBType]</value>
<value>-</value>
</variable>

xml:

<content>$VAR[getDBIDcontent]</content>