Kodi Community Forum

Full Version: script.embuary.helper - a skin helper service / widgets alternative
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
Embuary Helper Script
This script has been developed to get all of my Embuary features to work.
But since it's feature rich it's also useful for any other skinner who wants to get special things done in his own skinning project.

Supported Kodi versions
  • Krypton
  • Leia

Where to get it
  • The most current versions are always available on my private Kodi repo
  • The Leia version gets updated in intervals on the official Kodi repo
  • The Krypton version never hits the Kodi repo and is only available on my personal one

Important for TVOS and some Linux users
It's possible that you will get PIL errors in your logs. This error is not related to the script and is caused by incomplete or broken shipped Python PIL packages of your operation system. That means that things like the blurring feature won't work on your end.
I've muted the error for Krypton but haven't applied this to the Leia branch, because you guys (Linux users) should be able to fix it manually by changing your installed Python module packages.

Wiki / documentation
https://github.com/sualfred/script.embuary.helper/wiki

Help to translate the script into your language!
Translate on TransiFex

Donations
Free beer or money for the tip jar of my daughter is welcome and helps me to stay motivated Smile
Please click here to donate
That's awesome.
(2019-07-17, 10:18)sualfred Wrote: [ -> ]FYI and because some other skinners already are using my helper for Embuary in their projects:

script.embuary.helper is somehow comparable to the heavily used Skin Helper Service packages. The main difference is, that it doesn't call any information from the web, which makes it a lot of faster. For sure there are a lot of downsides like no real time Rotten ratings etc, but skinners which are looking for a way to get feature rich widgets or some helper functions are might be interested. 

With Kodi 19 Matrix we will also face the switch from Python 2.7 to Python 3 and I assume - if nobody will take care of it - that the Skin Helper stuff is going to break in the very beginning. I just want to offer you guys another way to get things implemented without having headaches because of a missing or broken dependency. 

Even if the helper was created for Embuary, it should not stop you to using it in other skins. It's available on the official Kodi repo and is already Python 3 ready. A Krypton version is available on my personal one.

I've made a documentation with all features so skinners should easily can see what is possible and what not:

Thread: 345318 (thread)
Wiki and documentation: https://github.com/sualfred/script.embuary.helper/wiki

Sounds great, did you consider to add a
'checkexist' funtion.


simple example
## -*- coding: utf-8 -*-
import xbmc
import xbmcvfs

trailerfilenamemp4 =  xbmc.getInfoLabel( "listitem.path" ) + xbmc.getInfoLabel( "listitem.FolderName" ) + "-trailer" + ".mp4"

if xbmcvfs.exists(trailerfilenamemp4):
    xbmc.executebuiltin( "SetProperty(trailer_avail,true,home)" )
else:
    pass

(may benefits on other things as well, e.g. i use it for check for local tv show trailers, https://streamable.com/zdr2f )
(2019-07-17, 14:11)sualfred Wrote: [ -> ]@mardukL 
https://github.com/sualfred/script.embua...5db5501a08
https://github.com/sualfred/script.embua...ile-exists

Will be available on the next version bump.

Great, thanks.
Yep, been working on transitioning from SH for a while now.
Just keep it simple so it won't become as massive as SH was...

it would be great if the whole package is separated into modules - helper/tools, plugin, service.
This will keep the code smaller, more readable, easy to maintain and a user/skinner would not be bound to install everything.

Anyways, good work as usual man.
No to modules. Some functions are shared. So there would be no benefit. Don't forget that the script is mainly created for Embuary.
Thank you @sualfred ! Your work is greatly appreciated.

Regards,

Bart
Amazing work.

Thankyou for adding this to the kodi repo.
@sualfred just started to use this and wanted to ask if it's possible to clear the contents of a list?

I'm using it to display a list of similar TV shows or Movies in the video info dialog but each time I check another item the old list is still cached for a second before the new one loads. If I could clear it when I unload the video info dialog that would be great.
Not really. This and the caching is handled by Kodi. As long as the same container is updating it won't clear the old existing content. But you could try to play with window props during load/unload of the info screen. If prop is filled -> $VAR[content] returns "-" for example. This will instantly clear it before.
Cheers.
@Hitcher 
Another approach just as suggestion. If you want I can add this window property directly to the script so it always sets a loading property + and clears it once endDirectory is reached.

In DialogVideoInfo.xml
Code:

    <onload>SetProperty(CL,1,home)</onload>
    <onload>AlarmClock(clearCL,ClearProperty(CL,home),00:01,silent)</onload>

Container layout:


                        <itemlayout condition="!String.IsEmpty(Window(Home).Property(CL))">
                                  ---- loading spinner for example ---
                        </itemlayout>
                        <itemlayout condition="String.IsEmpty(Window(Home).Property(CL))" width="257">
                            <control type="group">
                                <left>70</left>
                                <top>64</top>
                                <include content="CastLayout">
                                    <param name="mainlabel" value="$PARAM[mainlabel]" />
                                    <param name="sublabel" value="$PARAM[sublabel]" />
                                    <param name="labels_visible" value="$PARAM[labels_visible]" />
                                    <param name="focused" value="false" />
                                    <param name="id" value="$PARAM[id]" />
                                </include>
                            </control>
                        </itemlayout>
                        <focusedlayout condition="!String.IsEmpty(Window(Home).Property(CL))">
                                  ---- loading spinner for example ---
                        </focusedlayout>
                        <focusedlayout condition="String.IsEmpty(Window(Home).Property(CL))" width="257">
                            <control type="group">
                                <left>70</left>
                                <top>64</top>
                                <include content="CastLayout">
                                    <param name="mainlabel" value="$PARAM[mainlabel]" />
                                    <param name="sublabel" value="$PARAM[sublabel]" />
                                    <param name="labels_visible" value="$PARAM[labels_visible]" />
                                    <param name="focused" value="true" />
                                    <param name="id" value="$PARAM[id]" />
                                </include>
                            </control>
                        </focusedlayout>
This is not a request, just a question.

You mentioned in your first post that your helper doesnt get the information from the web which makes it a lot faster and for that reason you would not have live rotten tomatos ratings, etc.

for those of us who have the different ratings stored in our database for movies and tvshows, would you be able to display those ratings in different views and not just dialogvideoinfo using a feature in your helper?
Sadly not. Afaik there is no way to call them via JSON.
Pages: 1 2 3 4 5 6 7 8 9 10 11