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)



- pecinko - 2011-12-09

Martijn Wrote:That would run it each time you enter home am i right?
Maybe have it in startup.xml so it's started one time.

What if you use sleep instead of quit/shutdown on you htpc? I do.


- Hitcher - 2011-12-09

Now that ronie's added the running property I run it from Startup.xml and then use a conditional for the Home.xml in case someone has switched skins..

PHP Code:
<onload condition="IsEmpty(Window(Home).Property(Watchlist_Running))">RunScript(script.watchlist,movies=$INFO[Skin.String(Watchlist_Movies)]&amp;episodes=$INFO[Skin.String(Watchlist_Episodes)]&amp;albums=$INFO[Skin.String(Watchlist_Albums)]&amp;limit=6)</onload



- Martijn - 2011-12-09

Using 0.1.7 and no issues. Works like a charm


- pecinko - 2011-12-09

Hitcher Wrote:Now that ronie's added the running property I run it from Startup.xml and then use a conditional for the Home.xml in case someone has switched skins..

PHP Code:
<onload condition="IsEmpty(Window(Home).Property(Watchlist_Running))">RunScript(script.watchlist,movies=$INFO[Skin.String(Watchlist_Movies)]&amp;episodes=$INFO[Skin.String(Watchlist_Episodes)]&amp;albums=$INFO[Skin.String(Watchlist_Albums)]&amp;limit=6)</onload

Yup, but what do you think would be a solution for a situation were user is switching from a skin that uses say 4 items to a skin using 8. Or, from a skin not using music items in WL script to a skin that uses all.

All I came up with would be to run it on home.xml load to make sure all info would be fetched?

The way I see it you either re-run it on home with definable parameters or make a background service but with fixed parameters. I may be missing something, though?


- pieh - 2011-12-09

If this script should be automaticly run consider using service addon. Not sure if we could enable/disable it from skin tho.


- ronie - 2011-12-09

pieh Wrote:If this script should be automaticly run consider using service addon. Not sure if we could enable/disable it from skin tho.

pieh, when a users switches skins, why don't we start the new skin from Startup.xml ?

currently, when changing skins, we skip everything the new skin has defined in Startup.xml and this leads to missing bits and pieces in the skin.

any thoughts?


- ronie - 2011-12-09

pecinko Wrote:Yup, but what do you think would be a solution for a situation were user is switching from a skin that uses say 4 items to a skin using 8. Or, from a skin not using music items in WL script to a skin that uses all.

All I came up with would be to run it on home.xml load to make sure all info would be fetched?

The way I see it you either re-run it on home with definable parameters or make a background service but with fixed parameters. I may be missing something, though?

what i would do is to conditionally run the script in Home.xml only:
Quote:<onload condition="IsEmpty(Window(Home).Property(Quartz_Watchlist))">RunScript(script.watchlist,...)</onload>
<onload condition="IsEmpty(Window(Home).Property(Quartz_Watchlist))">SetProperty(Quartz_Watchlist,True)</onload>



- Hitcher - 2011-12-10

ronie Wrote:pieh, when a users switches skins, why don't we start the new skin from Startup.xml ?

currently, when changing skins, we skip everything the new skin has defined in Startup.xml and this leads to missing bits and pieces in the skin.

any thoughts?

This is probably the best solution.


- pecinko - 2011-12-10

Guys everything tells me to keep my mouth shut or risk being marked as major pain in the ass that's always complaining and requesting something but still:

I still think there's no way of telling what parameters were used by previous skin, meaning you need to re-run it with your own to be sure. Even with property check ronie suggested - ones the property is set it will not guard from future skin switches.

Maybe I'm just being stupid.. (you don't need to comfirm this Smile


- `Black - 2011-12-10

If a skin was changed, stop all scripts started by the previous skin, run startup.xml from the new skin and activate settings -> appearance. That would be the safest way... besides a skin could have it's own scripts which need to be run so you have to restart XBMC anyway at the moment.


- pecinko - 2011-12-10

Maybe, but I've been told we are in feature freeze.


- Martijn - 2011-12-10

pecinko Wrote:Maybe, but I've been told we are in feature freeze.

Just tell every one it's a bug Wink


- `Black - 2011-12-10

pecinko Wrote:Maybe, but I've been told we are in feature freeze.

Yep so if this doesn't make it to Eden, I wouldn't care about this problem too much. A quick restart of XBMC isn't much of a problem, no one changes a skin every 5 minutes... you're using one and that's it.


- pecinko - 2011-12-10

Well grumpy old fart (me) still thinks it would be better to sacrifice script options temporarily and make them hardcoded ATM. You would check if script is running and launch it if it's not.

I guess it's just my personal preference. I'll keep with the flow, of courz.


- ronie - 2011-12-10

let me try to clear up some of the confusion...

pecinko Wrote:I still think there's no way of telling what parameters were used by previous skin
indeed, and there's no need to.
your skin should just run the script with the parameters it needs.
the script will detect if it was previously started (by another skin) and kill that thread.

pecinko Wrote:Even with property check ronie suggested - ones the property is set it will not guard from future skin switches.

you don't need to worry about skin switches.
the only thing you have to make sure of is that you run the script once,
when a user starts your skin or switches to your skin.

the two lines of code i posted above should take care of that and it's all you need.

please let me know if there's anything you don't get or if i've missed something :-)