Kodi Community Forum
[RELEASE] Watchlist script (was 'Adding Plex's 'On Deck' feature to XBMC') - 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] Watchlist script (was 'Adding Plex's 'On Deck' feature to XBMC') (/showthread.php?tid=113702)



- ppic - 2011-11-07

with the know i have on this kind of scripts, db quering on big db + mysql on distant machine is what is causing some freezes


- ronie - 2011-11-08

script.watchlist-0.0.4.zip

@Big_Noid: i've added a possible fix for the freeze, but may need to make the same change in the next aired script as well.

oh, and i've added ratings as well :-)

@pecinko: your script failed issue should be fixed now

@odt_x: could you post another Debug Log with this version?


- pecinko - 2011-11-08

ronie Wrote:script.watchlist-0.0.4.zip

@Big_Noid: i've added a possible fix for the freeze, but may need to make the same change in the next aired script as well.

oh, and i've added ratings as well :-)

@pecinko: your script failed issue should be fixed now

@odt_x: could you post another Debug Log with this version?

All hail the king! Smile

This one is flawless.


- BigNoid - 2011-11-08

ronie Wrote:script.watchlist-0.0.4.zip

@Big_Noid: i've added a possible fix for the freeze, but may need to make the same change in the next aired script as well.

oh, and i've added ratings as well :-)
I can confirm this fixes the freezing issues. And thx for adding the ratings Smile


- odt_x - 2011-11-08

Hi!

Heres a sample of running the 0.0.4 version of the script and how long it takes for me.

http://pastebin.com/1dWXyWH7


- ronie - 2011-11-08

odt_x Wrote:Hi!

Heres a sample of running the 0.0.4 version of the script and how long it takes for me.

http://pastebin.com/1dWXyWH7

right, it's the json query that takes up most of the time.

the time it takes to get a response is approx 7 secs at your end:
Quote:22:20:47 T:208 DEBUG: script.watchlist: ### json query
22:20:54 T:208 DEBUG: script.watchlist: ### load response

the processing of the response in the script takes practically no time:
Quote:22:20:54 T:208 DEBUG: script.watchlist: ### load response
22:20:54 T:208 DEBUG: script.watchlist: ### iterate results
22:20:54 T:208 DEBUG: script.watchlist: ### sort list
22:20:54 T:208 DEBUG: script.watchlist: movie list: 74 items

so i doubt there's anything the script can do to speed things up.

things may be faster when using sqlite, but i'm not sure...
or perhaps your sql server is running on a slow/old machine
or maybe it's just the way things are :-)


- odt_x - 2011-11-08

Thanks for looking at the log. I guess Ill just have to stick to removing the movie fetching and properties, its no big deal but saves me a ton of time.


- ronie - 2011-11-08

odt_x Wrote:Thanks for looking at the log. I guess Ill just have to stick to removing the movie fetching and properties, its no big deal but saves me a ton of time.

heh, wouldn't it make much more sense if i let you call the script with some options?

eg. RunScript(script.watchlist,movies=true&episodes=true)


- Hitcher - 2011-11-09

ronie Wrote:heh, wouldn't it make much more sense if i let you call the script with some options?

eg. RunScript(script.watchlist,movies=true&episodes=true)

I was going to suggest this yesterday but didn't want to burden you anymore than I already have this week. Wink


- ronie - 2011-11-09

Hitcher Wrote:I was going to suggest this yesterday but didn't want to burden you anymore than I already have this week. Wink

pfff....anything else?
adding that option is 5 mins of work max ;-)


- Hitcher - 2011-11-09

ronie Wrote:pfff....anything else?

Well you could help me figure out the easiest way to allow users to select 4 home lists out of a possible 6 in the skin settings. Rolleyes


- ronie - 2011-11-09

Hitcher Wrote:Well you could help me figure out the easiest way to allow users to select 4 home lists out of a possible 6 in the skin settings. Rolleyes

lol, it might be less work to mod your home screen to fit 6 items, than to figure that one out.


- Hitcher - 2011-11-09

No room -

Image


- Martijn - 2011-11-09

Well maybe another hard one is using smartplaylists as a source Big Grin

Almost all skins support adding those as a menu item. Maybe nice to only show the ones that are in that particular smartplaylist.
This also reduces the number of movies/tvshows.
Don't know if this is something worth doing?

This is some option that is also missing for totals returned by recently added script. You get no total/watched/unwatched for smartplaylists that you have as a menu item.


- pecinko - 2011-11-09

ronie Wrote:pfff....anything else?
adding that option is 5 mins of work max ;-)

Well, you could take a look at this :-)

Code:
00:07:48 T:2904711872   DEBUG: ExecuteXBMCAction : Translating RunScript(script.watchlist)
00:07:48 T:2904711872   DEBUG: ExecuteXBMCAction : To RunScript(script.watchlist)
00:07:48 T:2904711872    INFO: initializing python engine.
00:07:48 T:2904711872   DEBUG: new python thread created. id=3
00:07:48 T:2954915840   DEBUG: Thread XBPyThread start, auto delete: 0
00:07:48 T:2954915840   DEBUG: Python thread: start processing
00:07:48 T:2954915840  NOTICE: -->Python Interpreter Initialized<--
00:07:48 T:2954915840   DEBUG: Process - The source file to load is /Users/tina/Library/Application Support/XBMC/addons/script.watchlist/default.py
00:07:48 T:2954915840   DEBUG: Process - Setting the Python path to /Users/tina/Library/Application Support/XBMC/addons/script.watchlist:/Users/tina/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/tina/Library/Application Support/XBMC/addons/script.module.xbmc-czech.common/lib:/Users/tina/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Users/tina/Library/Application Support/XBMC/addons/script.common.plugin.cache/lib:/Users/tina/Library/Application Support/XBMC/addons/script.module.parsedom/lib:/Users/tina/Library/Application Support/XBMC/addons/script.module.elementtree/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pysqlite/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages:
00:07:48 T:2954915840   DEBUG: Process - Entering source directory /Users/tina/Library/Application Support/XBMC/addons/script.watchlist
00:07:48 T:2954915840   DEBUG: Instantiating addon using automatically obtained id of "script.watchlist" dependent on version 2.0 of the xbmc.python api
00:07:48 T:2954915840   DEBUG: script.watchlist: script version 0.0.4 started
00:07:48 T:2954915840   DEBUG: script.watchlist: ### json query
00:07:48 T:2954915840   DEBUG: RunQuery took 9 ms for 123 items query: select * from movieview
00:07:49 T:2954915840   DEBUG: script.watchlist: ### load response
00:07:49 T:2954915840   DEBUG: script.watchlist: ### iterate results
00:07:49 T:2954915840    INFO: -->Python script returned the following error<--
00:07:49 T:2954915840   ERROR: Error Type: <type 'exceptions.KeyError'>
00:07:49 T:2954915840   ERROR: Error Contents: ('lastplayed',)
00:07:49 T:2954915840   ERROR: Traceback (most recent call last):
                                              File "/Users/tina/Library/Application Support/XBMC/addons/script.watchlist/default.py", line 183, in <module>
                                                Main()
                                              File "/Users/tina/Library/Application Support/XBMC/addons/script.watchlist/default.py", line 18, in __init__
                                                self._fetch_movies()
                                              File "/Users/tina/Library/Application Support/XBMC/addons/script.watchlist/default.py", line 52, in _fetch_movies
                                                lastplayed = item['lastplayed']
                                            KeyError: ('lastplayed',)
00:07:49 T:2954915840    INFO: -->End of Python script error report<--
00:07:49 T:2954915840    INFO: Python script stopped
00:07:49 T:2954915840   DEBUG: Thread XBPyThread 2954915840 terminating
00:07:49 T:2904711872   DEBUG: waiting for python thread 3 to stop
00:07:49 T:2904711872   DEBUG: python thread 3 destructed
00:07:49 T:2904711872   DEBUG: ------ Window Init (DialogKaiToast.xml) ------