• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15
Release Embuary Helper Script
#76
(2019-07-21, 09:38)sualfred Wrote: @wyrm 
https://github.com/sualfred/script.embua...b1fb2e9a83

Call (see guisettings.xml for reference):
Code:
RunScript(script.embuary.helper,action=getkodisetting,setting=locale.country)

Returns:
Code:
Window(home).property(locale.country)
Example: "Australia (12h)"


Call with stripping the time format:
Code:
RunScript(script.embuary.helper,action=getkodisetting,setting=locale.country,strip=timeformat)

Returns:
Code:
Window(home).property(locale.country)
Example: "Australia"

Thanks mate,

Will have a play as soon as I can leaver the children off of the computer.

Wyrm
Reply
#77
(2019-07-21, 09:44)sualfred Wrote: @roidy 

Thanks for the suggestion, but that won't work without storing the name as window property as cache. And this is much more expensive than just checking if the file already exists. If file is already exists it's just updating the window property.

Edit:
"Fun fact" -> A reason why the skin helper service stuff got so slow is its caching. Sometimes it's better to keep it simple.

Umm.... I'm not sure why you say the name needs to be stored as a window property or even mention cache.... Nothing need to be cached, the value of image just need to be saved in a global variable and checked like so:-

python:
old_image = ""

def image_filter(prop='listitem', file=None, radius=BLUR_RADIUS):
  global old_image
  image = file if file is not None else xbmc.getInfoLabel('Control.GetLabel(%s)' % BLUR_CONTAINER)
  try:
    radius = int(radius)
  except ValueError:
    log('No valid radius defined for blurring')
    return
  if image:
    if image != old_image:
      log("Image has changed")
      old_image = image
      blurred_image, imagecolor = image_blur(image, radius)
      winprop(prop + '_blurred', blurred_image)
      winprop(prop + '_color', imagecolor)
    else:
      log("No image change detected")

I've tested this code and it works fine.... "hashlib.md5", "xbmc.getCacheThumbName" and "xbmcvfs.exists" seem to be expensive in my testing running on a Odroid N2 S922 and timing the blur function i get the following results:-

Original code:
0.025 to 0.033 seconds / ~28 milliseconds per call

My modified code:
0.00023 to 0.00037 seconds / ~300 microseconds per call

So quite a saving.
Reply
#78
@roidy 

Ah, you are right. Thanks. For whatever reason I thought the global var will always be resettet on each cycle. Still learning Python. Sorry for declining your suggestion at first. Changed it on GitHub.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#79
@sualfred No problem, it's your code and you don't have to add anything you don't want to.... I'm just trying to get the code running as fast as possible, on low end hardware every cycle counts Big Grin

Interesting use of "not"

python:
if not image == OLD_IMAGE:

I rushed writing the code, I should of combined the 2 "IF" statements into something like:

python:
if image and image is not old_image:

But now we are just getting into coding style preferences that really make no difference   Laugh
Reply
#80
Suggestions are always welcome if they make sense Smile

I prefer "not". My brain is getting less tilt by using if statements like this.
And yeah, one if statement would also work but I want to output the image name in debug logging.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#81
(2019-07-21, 06:23)sualfred Wrote: correct <content>plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.actorart&string='$ESCINFO[Container(344).ListItem.Cast]'</content>
That's exactly what I've already tried and there is nothing happening.

Code:
        <control type="group">        
            <control type="list" id="344">
                <left>3000</left>
                <height>1</height>
                <width>1</width>
                <autoscroll>true</autoscroll>
                <scrolltime>5000</scrolltime>
                <itemlayout/>
                <focusedlayout/>
                <content>plugin://script.embuary.helper?info=getcast&amp;type=$INFO[ListItem.DBType]&amp;dbid=$INFO[ListItem.DBID]</content>
            </control>        
            <control type="list" id="345">
                <left>3000</left>
                <height>1</height>
                <width>1</width>
                <autoscroll>true</autoscroll>
                <scrolltime>5000</scrolltime>
                <itemlayout/>
                <focusedlayout/>
                <content>plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.actorart&string='$ESCINFO[Container(344).ListItem.Cast]'</content>
            </control>
            <control type="image">
                <left>1000</left>
                <top>150</top>            
                <width>548</width>
                <height>548</height>        
                <aspectratio align="center" aligny="bottom">keep</aspectratio>
                <texture background="true">$INFO[Container(345).ListItem.Icon]</texture>                
                <fadetime>1000</fadetime>                                
            </control>
        </control>

That's the reason why I tried to replace [Container(344).ListItem.Cast] with a [Container(344).ListItem.Label]. Now there are pictures but the empty ones are not skipped anymore.
Reply
#82
No you don't. You list a cast in 344 but you need getbydbid.

       
Code:
            <control type="list" id="344">
                <left>3000</left>
                <height>1</height>
                <width>1</width>
                <itemlayout/>
                <focusedlayout/>
                <content>plugin://script.embuary.helper?info=getbydbid&amp;type=$INFO[ListItem.DBType]&amp;dbid=$INFO[ListItem.DBID]</content>
            </control>
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#83
(2019-07-21, 15:28)sualfred Wrote: No you don't. You list a cast in 344 but you need getbydbid.
Haha, indeed it's working now! A bit slower than in dialogvideoinfo but working nice!
There is a error on each get into the view and skin reload, can y plz check or hide at next github update?
Edit: and on kodi restart...


give me a moment i give you log...


EDIT: LOG
Reply
#84
Answer is here:
https://forum.kodi.tv/showthread.php?tid...pid2867685
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#85
(2019-07-12, 11:53)sualfred Wrote: ListItem.DBID + ListItem.DBType is empty. These items have to be available. 

use a variable:
Great thanks! Working great!

On testing i got almost all working in dialogvideoinfo. Now also cast in working in views.
I got all other working also in views except Directors, but using the same code as Countries and Studios.

working:
plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.actorart&string='$ESCINFO[Container.ListItem.Cast]'
plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.moviecountryicons.flags&separator='" / "'&string='$ESCINFO[ListItem.Country]'
plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.studios.white&separator='" / "'&string='$ESCINFO[ListItem.Studio]'
nothing happen, no error just nothing:
plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.moviedirectorthumbs&separator='" / "'&string='$ESCINFO[ListItem.Director]'

With the onload runscript way this is working but not this way, any idea?

EDIT: ok tested out further, directors working this way not in dialogvideoinfo or other views, but with the other runscript way it does.
Reply
#86
ok, just to be on the safe side, i used the country flags resource addon instead and renamed a director to "Austria". A flag will appear!
He does not accept the resource addon here, but in does on the other onload runscript, both have been running parallel on the screen at the same time.

EDIT: Found the error, The new code takes only PNG and no JPG.
The onload runscript does not care about the file extension.

@Hitcher sry for language fail, opened 100 xml boxes and forgot my brain.
Reply
#87
English only please.

EDIT: No problem and thanks.
Reply
#88
@"chrissix" 

jpg support added on github

edit:
I highly suggest you to remove all .url files from the resource directory. It's already super slow with that amount of files that you have stored. (100k< !)
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#89
(2019-07-21, 17:33)sualfred Wrote: jpg support added on github

edit:
I highly suggest you to remove all .url files from the resource directory. It's already super slow with that amount of files that you have stored.
Great!
Yes, on revision 3 of this addon i will do it! Never experienced negative side effect cause it wasn't used on a scroll list, just in dialogvideoinfo with delay.
____
On newest github release still see no images+errors+kodi crash completely with error "main loop", but only when adding the short director code in the view:

Code:
            <!-- Country Thumb -->                
            <control type="group">        
            <control type="list" id="128">
                <left>3000</left>
                <height>1</height>
                <width>1</width>
                <autoscroll>true</autoscroll>
                <scrolltime>10000</scrolltime>
                <itemlayout/>
                <focusedlayout/>
                <content>plugin://script.embuary.helper/?info=getresourceimages&addon=resource.images.moviedirectorthumbs&separator='" / "'&string='$ESCINFO[ListItem.Director]'</content>
            </control>
            <control type="image">
                <left>311</left>
                <top>124</top>
                <width>125</width>
                <height>80</height>
                <aspectratio align="center" aligny="bottom">stretch</aspectratio>
                <texture background="true" colordiffuse="80FFFFFF">$INFO[Container(128).ListItem.Icon]</texture>
                <fadetime>1000</fadetime>            
            </control>
            </control>

i'll post a log
Reply
#90
Log -> link

removed all other code, leaved only the short director code above in so you'll have a clean log.
no imagas, kodi error messages, all textures crash, kodi complete crash.
___

EDIT: Now i tried it with just 1 .jpg resource, it's working! It seems that this solution isn't suitable for hight resource amount.
I have no idea of how it works, bit it seems that on this solution it is searching after resources and not just matching.
Maybe that's the reason of the crash cause it's searching of a tooo high amount.
The onscipt solution think does a direct matching cause there are no negative side effects, it's showing immediate also with this high resource amount.
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15

Logout Mark Read Team Forum Stats Members Help
Embuary Helper Script3