Kodi Community Forum
Release skin helper service - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
---- Thread: Release skin helper service (/showthread.php?tid=235676)



RE: skin helper service - _Andy_ - 2015-11-09

Hello

I recently read Aeon Nox uses the skin.helper.service too. So i grabbed the git version from today and installed in my addon folder. After starting Kodi (Kodi 16 Jarvis, nightly from today) i got an error.
Code:
21:59:53 T:3784   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: must be string without null bytes or None, not str
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\Kodi16\portable_data\addons\script.skin.helper.service\service.py", line 8, in <module>
                                                from resources.lib.WebService import WebService
                                              File "C:\Program Files (x86)\Kodi16\portable_data\addons\script.skin.helper.service\resources\lib\WebService.py", line 4, in <module>
                                                import SimpleHTTPServer, BaseHTTPServer, httplib
                                              File "C:\Program Files (x86)\Kodi16\system\python\Lib\SimpleHTTPServer.py", line 27, in <module>
                                                class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
                                              File "C:\Program Files (x86)\Kodi16\system\python\Lib\SimpleHTTPServer.py", line 214, in SimpleHTTPRequestHandler
                                                mimetypes.init() # try to read system mime.types
                                              File "C:\Program Files (x86)\Kodi16\system\python\Lib\mimetypes.py", line 351, in init
                                                db.read_windows_registry()
                                              File "C:\Program Files (x86)\Kodi16\system\python\Lib\mimetypes.py", line 254, in read_windows_registry
                                                with _winreg.OpenKey(hkcr, subkeyname) as subkey:
                                            TypeError: must be string without null bytes or None, not str
                                            -->End of Python script error report<--

Do you know whats wrong?


RE: skin helper service - User 224999 - 2015-11-09

(2015-11-09, 23:19)_Andy_ Wrote: Do you know whats wrong?

Well, this is a high level python error that is going wrong...
I have no clue, never saw this error before.

I can add some error handling in the script around this error but that will basically only disable the webservice and you will miss some features probably.
Maybe google for this error:

mimetypes.init() # try to read system mime.types
File "C:\Program Files (x86)\Kodi16\system\python\Lib\mimetypes.py", line 351, in init
db.read_windows_registry()
File "C:\Program Files (x86)\Kodi16\system\python\Lib\mimetypes.py", line 254, in


RE: skin helper service - im85288 - 2015-11-09

Great work with the new palette colours. My only remaining wish list for this helper addon is for it to scrape the IMDb Top250 info...oh and to have it fetch a beer for me from the fridge Smile


RE: skin helper service - Angelinas - 2015-11-09

(2015-10-28, 20:22)marcelveldt Wrote:
(2015-10-28, 20:20)Angelinas Wrote: @Marcel Have you planed to add "info for Cast" in PVR.(from IMDB or TMDB) as Label.Latter some thumb for them. Smile
PHP Code:
$INFO[Window(Home).Property(SkinHelper.PVR.Cast)]
$INFO[Window(Home).Property(SkinHelper.PVR.Role)] 

First release to the Kodi repo, after that I will look into adding more features
Marcel
Have some time for this?

This working but only for Movies and TVShow when is in my library.It will be nice to have short info for Cast when Movies isn't in library :-)
Home Window show Images from widget PVR
Image


RE: skin helper service - User 224999 - 2015-11-10

(2015-11-09, 23:38)im85288 Wrote: Great work with the new palette colours. My only remaining wish list for this helper addon is for it to scrape the IMDb Top250 info...oh and to have it fetch a beer for me from the fridge Smile

Isn't that info already in the Kodi library ? or do you mean to get a plugin entrypoint to fetch the top250 ?


RE: skin helper service - BobCratchett - 2015-11-10

Hi Marcelveldt. Can I please make a feature request... Angel

We discussed a little while ago allowing the user to install additional widget providers when using skin helper in parallel with skin shortcuts to select widgets. I've now done the basics of the skin shortcuts side, but modifying the skin helper side is unfortunately beyond me.

The trouble is that the skin helper (from what I can see from following the code) loads the list of widgets in advance and keeps them cached for when skin shortcuts asks for them to be displayed. However, when additional widget providers are installed we still get the cached version - which doesn't include the additional widgets that are now available. I can see that it gets updated every 30 mins, but that's a little bit too long to wait Wink

I don't know the skin helper code well enough to know what the best solution to this is, but ideally can you please look into a way for skin shortcuts to trigger a refresh (with, preferably, a new request for the widget list - which, from the skin shortcuts side - will come straight after waiting until this is loaded before returning. Or however is the best way to do it!

Cheers Smile


RE: skin helper service - User 224999 - 2015-11-10

(2015-11-10, 00:11)BobCratchett Wrote: I don't know the skin helper code well enough to know what the best solution to this is, but ideally can you please look into a way for skin shortcuts to trigger a refresh (with, preferably, a new request for the widget list - which, from the skin shortcuts side - will come straight after waiting until this is loaded before returning. Or however is the best way to do it!

Uhm, I can add an entrypoint which you can call to perform a refresh of the cache...
Also, should that code be in skinshortcuts or maybe better move it into the function in skinhelper that lists all the widget entries ?
skinhelper also probes all widget netries to determine the content in the background which can be a bit slow (that's why the caching is there)...

I'll take a look at what you created so far. Nice work :-)


RE: skin helper service - BobCratchett - 2015-11-10

(2015-11-09, 02:57)marcelveldt Wrote: Yeah, they are not usable, they can only be read by skinshortcuts.
So, this means the problem is in skinshortcuts then. I will take a look at it tomorrow.

Did you also try to browse any addons in skinshortcuts ?

I've tried to look into this myself as best I can (as someone who doesn't have an Android device). Whilst I didn't get too far, possibly this might help track down where the issue is.

My instinct is to say that skin shortcuts isn't failing, based on the fact that a select dialog (albeit an empty one, from the reports - though I'm guessing that the dialog shows the ".." item) - that will only display after skin shortcuts has received and processed a listing from json. That suggests that the json is returning something that is valid, and skin shortcuts is able to process it.

I do know, from my failed attempts at trying to clear the skin helper services widget cache remotely, that if the cache is empty then that is exactly what skin shortcuts will display (naturally, as skin helper has no widgets to return to it), so my guess would be that something is going wrong in pre-caching the widgets. My further guess, as this is only happening on Android, and earlier JayZ showed a link to try and show the extended info script, is that it could - possibly - be that script causing the issue, as I know it has previously had some problems working on Android due to the lack of PIL on that platform.

That's just a guess, though, and as I say I really can't look into it any further without access to Android.


RE: skin helper service - im85288 - 2015-11-10

(2015-11-10, 00:02)marcelveldt Wrote:
(2015-11-09, 23:38)im85288 Wrote: Great work with the new palette colours. My only remaining wish list for this helper addon is for it to scrape the IMDb Top250 info...oh and to have it fetch a beer for me from the fridge Smile

Isn't that info already in the Kodi library ? or do you mean to get a plugin entrypoint to fetch the top250 ?

There is a place for it already in the Kodi library (ie. Listitem.top250) but no scrapers (Kodi or Emby) gather this data. So to have that data displayed/scraped you have to install another addon and none of them are in the official Kodi repo. Preferably this could be done with this addon to prevent that as many users simply are not aware of where to go to find the addon to do that.


RE: skin helper service - BobCratchett - 2015-11-10

(2015-11-10, 00:18)marcelveldt Wrote:
(2015-11-10, 00:11)BobCratchett Wrote: I don't know the skin helper code well enough to know what the best solution to this is, but ideally can you please look into a way for skin shortcuts to trigger a refresh (with, preferably, a new request for the widget list - which, from the skin shortcuts side - will come straight after waiting until this is loaded before returning. Or however is the best way to do it!

Uhm, I can add an entrypoint which you can call to perform a refresh of the cache...
Also, should that code be in skinshortcuts or maybe better move it into the function in skinhelper that lists all the widget entries ?
skinhelper also probes all widget netries to determine the content in the background which can be a bit slow (that's why the caching is there)...

I'll take a look at what you created so far. Nice work :-)

Thanks for looking into it Smile

I'm happy with it in Skin Shortcuts just because I'm using the 'Get More...' button of the select dialog to trigger the process, as that seems a natural place for it. That and I'm just so much more familiar with the Skin Shortcuts code Wink I'm happy for it to be switched, though, if that's the prevailing opinion of where its best done.


RE: skin helper service - User 224999 - 2015-11-10

(2015-11-10, 00:21)BobCratchett Wrote: My instinct is to say that skin shortcuts isn't failing, based on the fact that a select dialog (albeit an empty one, from the reports - though I'm guessing that the dialog shows the ".." item) - that will only display after skin shortcuts has received and processed a listing from json. That suggests that the json is returning something that is valid, and skin shortcuts is able to process it.

This is strange issue... I even tried to install Android x86 on a virtual machine today to debug this but Kodi doesn't run than...
The fact that he gets that listing means that the cache is actually working. So the problem must be in the process where the data is handed over to skinshortcuts.
Speaking of that btw: Maybe it's better if I add a json webservice to skinhelper which skinshortcuts can call to get the widgets listings, that would be much faster and easier to understand.


RE: skin helper service - User 224999 - 2015-11-10

(2015-11-10, 00:22)BobCratchett Wrote: I'm happy with it in Skin Shortcuts just because I'm using the 'Get More...' button of the select dialog to trigger the process, as that seems a natural place for it. That and I'm just so much more familiar with the Skin Shortcuts code Wink I'm happy for it to be switched, though, if that's the prevailing opinion of where its best done.

I don't mind where the ctual code is, I know both projects prettu well in the meanwhile ;-)
It's just that I'm thinking about the logic to get this right...

I was thinking about the following... list all options. If a user clicks a addon that isn't installed, popup the Kodi default question if the addon should be installed.
That would require no special dialogs at all, just a query to the addonpath would be enough to trigger kodi with the question


RE: skin helper service - BobCratchett - 2015-11-10

(2015-11-10, 00:29)marcelveldt Wrote:
(2015-11-10, 00:22)BobCratchett Wrote: I'm happy with it in Skin Shortcuts just because I'm using the 'Get More...' button of the select dialog to trigger the process, as that seems a natural place for it. That and I'm just so much more familiar with the Skin Shortcuts code Wink I'm happy for it to be switched, though, if that's the prevailing opinion of where its best done.

I don't mind where the ctual code is, I know both projects prettu well in the meanwhile ;-)
It's just that I'm thinking about the logic to get this right...

I was thinking about the following... list all options. If a user clicks a addon that isn't installed, popup the Kodi default question if the addon should be installed.
That would require no special dialogs at all, just a query to the addonpath would be enough to trigger kodi with the question

Unless you're thinking of changing how the widgets are listed in skin helper to a hierarchical-by-addon list, that wouldn't work as - unless Library Data Provider, Extended Info & Smart(ish) widgets are installed, skin helper doesn't know what widgets they provide (as at the moment it gets the widget options directly from the widget provider when it caches them.) Split up hierarchically that could work - click on 'Library Data Provider widgets >' and Kodi asks you if you want to install it - but doing it that way would, I suspect, make it harder to skinners to decide how to arrange the various widget providers themselves as they can currently do...


RE: skin helper service - Jayz2K - 2015-11-10

(2015-11-10, 00:21)BobCratchett Wrote: - though I'm guessing that the dialog shows the ".." item) -

That's it.
Once again, I really think the cache is building or trying to build because like on windows, it takes some time at first launch or after addon data wipe.

What I will try as soon as I can is to remove the grouping method and / or add standard library data provider to see if I get something different or logs (if that damn nexus player finally want to upload one).


RE: skin helper service - User 224999 - 2015-11-10

(2015-11-10, 00:33)BobCratchett Wrote: Unless you're thinking of changing how the widgets are listed in skin helper to a hierarchical-by-addon list, that wouldn't work as - unless Library Data Provider, Extended Info & Smart(ish) widgets are installed, skin helper doesn't know what widgets they provide (as at the moment it gets the widget options directly from the widget provider when it caches them.) Split up hierarchically that could work - click on 'Library Data Provider widgets >' and Kodi asks you if you want to install it - but doing it that way would, I suspect, make it harder to skinners to decide how to arrange the various widget providers themselves as they can currently do...

That was indeed what I was thinking... Maybe have both... If you call the skinhelper widgets entry with no params it would show the entries for all addons providing content (which can also be installed on request).
Besides that keep the filter active if skinners want to have control over what widgets to show and what not...

On the other hand the "get more" button is also a nice idea :-)

As this thread is read by many skinners maybe everyone can join the discussion how this should look like ideally ?

option 1: Get a widget listing with all addons providing widgets, such as extendedinfo, librarydata etc. If a user clicks an entry for an addon that isn't installed a question will popup if the addon should be installed.

option 2: In the widget listing of skinshortcuts (the selectdialog), have the "Get more" button displayed. This will result in a popup with available providers to install.

option 3: a combination of 1 and 2 :-)


This forum uses Lukasz Tkacz MyBB addons.