WIP TMDB Movies & TV Shows Screen Saver
#1
Hi All, I wrote a screen saver that shows movie and tv show fanart  /description / poster / rating. It gets data updated daily so that the content is somewhat dynamic as some api calls are airing today and now playing etc... I would like to submit it and would love if some people could test it out and highlight and errors or whatever else I need to do before submitting it. Pretty nervous about it working and Im new to python, thanks in advance, cant wait to hear your feedback.

The one thing bothering me at the moment is the first start up time, which is about 2-3 secs until data appears, which I know is most likely a delay because of the api call etc.. Only happens on first run though as subsequent opens pull from simplecache.

UPDATED 23-04-2019:
- Added extra customization options in settings.xml 
  - Fanart only options
  - Remove Information
  - Light or Dark Overlay options
  - Remove color option
  - Remove topbar option
- Safeguarded against string errors (I hope!) 

Thanks.

Main Repo is here: github.com/nazarja/movies-and-tvshows-screensaver
Zip to install is here: script.screensaver.moviesandtvshows.zip

Screenshots:

 Image

 CREDITS:
 - zag2me For the screensaver starter example
 - Lunatixz: For learning from his google earth screensaver code
 - jurialmunkey: For assets from Aura and styling inspiration
 - marcelveldt: For assets from image-overlays pack
 Thanks!
Reply
#2
Hello @nazarja

Thanks for this new add-on and I really like the concept. I have the following comments...

1. There is an error in the log...
xml:
2019-04-23 05:21:09.142 T:11464 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'\u2019' in position 15: ordinal not in range(128)
Traceback (most recent call last):
File "F:\Kodi v18- Nightly\portable_data\addons\script.screensaver.moviesandtvshows\gui.py", line 58, in onInit
self.getCache()
File "F:\Kodi v18- Nightly\portable_data\addons\script.screensaver.moviesandtvshows\gui.py", line 76, in getCache
self.rotateItems(data_cache)
File "F:\Kodi v18- Nightly\portable_data\addons\script.screensaver.moviesandtvshows\gui.py", line 86, in rotateItems
self.setItem(self.next)
File "F:\Kodi v18- Nightly\portable_data\addons\script.screensaver.moviesandtvshows\gui.py", line 119, in setItem
self.getControl(7700).setLabel(str(data['overview']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 15: ordinal not in range(128)
-->End of Python script error report<--
2019-04-23 05:21:09.188 T:4628 DEBUG: CCurlFile::GetMimeType - https://image.tmdb.org/t/p/w1280/sAzw6I1...QeWtaq.jpg -> image/jpeg
2019-04-23 05:21:09.189 T:4628 DEBUG: CurlFile::Open(0x2ab42151c80) https://image.tmdb.org/t/p/w1280/sAzw6I1...QeWtaq.jpg
2019-04-23 05:21:09.198 T:4012 DEBUG: CCurlFile::GetMimeType - https://image.tmdb.org/t/p/w500/nVN7Dt0X...LYklbY.jpg -> image/jpeg
2019-04-23 05:21:09.198 T:4012 DEBUG: CurlFile::Open(0x2ab42151fc0) https://image.tmdb.org/t/p/w500/nVN7Dt0X...LYklbY.jpg
Full log... https://paste.kodi.tv/ijiradeziw.kodi

2. The screensaver would only rotate 3 titles, then stop on the last one, probably due to the above error.

3. These are personal comments...
- I think that the fanart is way too muted, to the point where darker fanart is difficult to see.
- With almost half the screen used for text, it makes it even more difficult to appreciate the fanart.
- The poster is tiny, and difficult to see from a distance.
- The text banner that takes up half the screen seems too big. I just feel that for a screensaver, the image should have priority while the plot should be secondary.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
@Karellen  Thanks so much for that great feedback, I cant seem to replicate the error on my side, but I think it because I used .loads() instead of .load() when converting the json response. Changed that and still working ok for me. I agree on the styling and have reduced the panel size and lowered the text as much as the plot will allow, ive also increased the poster size, you were right there also. Thanks for the initial test, second set of eyes makes the difference. Uploaded new zip.
Reply
#4
(2019-04-23, 00:07)nazarja Wrote: @Karellen  Thanks so much for that great feedback, I cant seem to replicate the error on my side, but I think it because I used .loads() instead of .load() when converting the json response. Changed that and still working ok for me. I agree on the styling and have reduced the panel size and lowered the text as much as the plot will allow, ive also increased the poster size, you were right there also. Thanks for the initial test, second set of eyes makes the difference. Uploaded new zip.
Try with a movie that has an extended character in it's name.  I know from experience troubleshooting Artist Slideshow that the error posted above is because you're trying to display or manipulate something with an UTF-8 character when the Python code is expecting only ASCII characters.
Reply
#5
(2019-04-23, 00:16)pkscout Wrote: because you're trying to display or manipulate something with an UTF-8 character when the Python code is expecting only ASCII characters.

This statement is misleading. Python has full Unicode support and can handle characters of basically any possible world's character set. Good rule is to store all text that is meant to be read by people as unicode strings. However, in many cases Kodi API accepts only UTF-8 encoded byte strings (str type in Python 2). In such cases Python 2 implicitly converts unicode to str using system-default encoding which is ASCII in Python 2 for historical reasons. To avoid those problems you need to explicitly encode unicode strings into UTF-8 encoding when passing them to Kodi API. Or, considering the future migration to Python 3, I'd recommend to use kodi-six library that normalizes string handling in Kodi API: https://github.com/romanvm/kodi.six

BTW, there is no such thing as "UTF-8 character". UTF-8 is a Unicode-compatible variable-length encoding for representing text in binary form.
Reply
#6
Thank you both for the information.
Reply
#7
Just wondering if this is still maintained? I am getting an error on install, but it looks great! Does it use extra fanart too?
Reply

Logout Mark Read Team Forum Stats Members Help
TMDB Movies & TV Shows Screen Saver0