Kodi Community Forum

Full Version: script.embuary.info - get TMDb data - the little ExtendedInfo brother
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 12 13 14 15 16 17 18 19 20 21 22 23 24
(2019-08-17, 13:22)sualfred Wrote: [ -> ]I've added a small and optional context menu addon to use the script in any skin. It's already availalbe in my repo and has been submitted to the Kodi repo. Should be available soon to everyone.

Works very well! Maybe you can add something to override the onback function like in extendedinfo? Smile

snippet:
python:
        onback = self.getProperty("%i_onback" % control_id)
        onback = self.getProperty("%i_onback" % control_id)
        if onback:
            xbmc.executebuiltin(onback)

so if onback, i can set focus to a controllist f.e. 

xml:
<onload>SetProperty(10052_onback,SetFocus(9000))</onload>
then it would be perfect for me Smile
Nope. Onback is used to call the dialog history/previous dialog.

Edit:
Err.. wait. What exactly should happen if you trigger onback? Changing the focus without closing or what exactly?
Ah, sorry, it's already late.

Please try the latest GitHub commit.

Examples:
  • <onload>SetProperty(onclose,SetFocus(100))</onload> = To set a general action if a window is going to be closed. Like reseting the focus to a default control
  • <onload>SetProperty(onback_10052,SetFocus(900))</onload> = Don't close the window, but set focus to ID 900 if onback was called while container 10052 was in focus.
(2019-08-17, 22:29)sualfred Wrote: [ -> ]Nope. Onback is used to call the dialog history/previous dialog.

Edit:
Err.. wait. What exactly should happen if you trigger onback? Changing the focus without closing or what exactly?

Phil added a function for me in extended info where you could set an onback property for a specific container. If the property was set and that container focused, then the script would do the action in the property rather than close the dialog.

It is mostly used so that you can send focus back to the top list or row of buttons on back rather than close the window.

EDIT: I see you've just added it Wink
Yeah, thanks. My brain is just not working as it should on midnight so it took a few minutes until I understood the request Wink
Nice, so my onback actions from the lists will now be honoured and focus will go back my main buttons instead of closing the dialog?
Yes, but the onback commands from your lists will still be ignored but you can add them in the header of the dialogs via onload as setproperty for all containers where you want to have your own onback command.
Understood, thanks.
works like a charm, thanks a lot Smile
Hi @sualfred Getting a repeatable error on a specific movie in my library all the others I have checked work fine. Not sure what is so special about this one Huh

I am using:
xml:

RunScript(script.embuary.info,call=movie,external_id=$INFO[ListItem.IMDBNumber])

Here is full LOG.

Error report:
xml:

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xe9' in position 16: ordinal not in range(128)
Traceback (most recent call last):
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\default.py", line 51, in <module>
Main()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\default.py", line 19, in __init__
TheMovieDB(self.call,self.params)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 37, in __init__
self.entry_point()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 108, in entry_point
dialog = self.fetch_person() if self.call == 'person' else self.fetch_video()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 131, in fetch_video
data = TMDBVideos(self.call_params)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_video.py", line 47, in __init__
self.result['similar'] = self.get_similar()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_video.py", line 138, in get_similar
list_item = tmdb_handle_movie(item,self.local_movies)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_utils.py", line 401, in tmdb_handle_movie
list_item.setProperty('file', str(local_info['file']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 16: ordinal not in range(128)
-->End of Python script error report<--

Thanks Smile

EDIT: Found another movie
Same traceback but different position.
Code:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in position 30: ordinal not in range(128)
Do you want another log?

Quick search on Google led me HERE.

Don't know if that helps but I do see str on line 401 in tmdb_utils.

I also have no idea what I am talking about... Confused
Thanks, should be fixed on my repo.

@mikeSiLVO 
Could you please confirm?
Sorry, but I am still getting the same error.
xml:

2019-08-19 03:17:38.097 T:18446744073709551614 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xe9' in position 16: ordinal not in range(128)
Traceback (most recent call last):
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\default.py", line 51, in <module>
Main()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\default.py", line 19, in __init__
TheMovieDB(self.call,self.params)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 37, in __init__
self.entry_point()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 108, in entry_point
dialog = self.fetch_person() if self.call == 'person' else self.fetch_video()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_main.py", line 131, in fetch_video
data = TMDBVideos(self.call_params)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_video.py", line 47, in __init__
self.result['similar'] = self.get_similar()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_video.py", line 138, in get_similar
list_item = tmdb_handle_movie(item,self.local_movies)
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\script.embuary.info\resources\lib\tmdb_utils.py", line 377, in tmdb_handle_movie
filenameandpath = str(local_info.get('file')).encode('utf-8')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 16: ordinal not in range(128)
-->End of Python script error report<--
Found the issue. Gimme a few.

@mikeSiLVO 

solved
(2019-08-19, 09:39)sualfred Wrote: [ -> ]Found the issue. Gimme a few.

@mikeSiLVO 

solved

Yep!

Thanks Smile
(2019-08-17, 13:22)sualfred Wrote: [ -> ]I've added a small and optional context menu addon to use the script in any skin. It's already availalbe in my repo and has been submitted to the Kodi repo. Should be available soon to everyone.

Sorry for beeing late, and just to get you right - with this i dont need to set the propertys for the items via a hidden button and also dont need to put button+action in dialogcontextmenu.xml (like it was in early release)
??
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24