Kodi Community Forum
[RELEASE] Random and last items smartplaylist script for Skins - 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] Random and last items smartplaylist script for Skins (/showthread.php?tid=122448)



RE: [RELEASE] Random and last items smartplaylist script for Skins - warlion - 2014-02-13

Hi all, mike thanks for you work on this script i just had a few question before i start changing a few lines

I'm porting Aeon Nox 4 to Gotham and when i try the widgets they are always populate only with movies and random it never take the current playlist I'm selecting, so my question, is this script working correct over Gotham ?
I'm just asking because i like to know if this is a skin problem or Gotham problem before i start looking over the code
Thanks


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-13

I think it's OK. Il will try with your Aeon Nox 4.1.9 Gotham version tomorrow


RE: [RELEASE] Random and last items smartplaylist script for Skins - warlion - 2014-02-13

thanks mike i appreciate


RE: [RELEASE] Random and last items smartplaylist script for Skins - Quiksmage - 2014-02-14

Hey Mike,
I was the other guy with a large collection.
Currently I run aeon mq5 on a i7 [email protected] ghz 32 gb ddr3 1600 gtx 780
even with a beast system like that the return takes such a long time.
What would you recommend me doing to decrease the load time
My home screen is setup like this with estimated load times
Movies - ~700 movies - ~1 minute load time
TV - ~5000 episodes (setup as TV Shows so that it lists the TV Shows rather than just a playlist of episodes) - ~10 minutes load time
Anime - ~5000 episodes (same as above) - ~10 minutes load time
Anime Movies - ~70 movies - ~10-15 second load time
90s - ~2000 episodes (same as other tv) - ~5 minutes load time
90s Movies - ~100 movies - ~20 second load time


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-14

Thanks for your setup and your estimated loading time.

As I already mention, using TV SHows smart playlist on huge library is time killer because the script have to make a lot of sub-query to get information about seasons and episodes.

I think that if you change your smart playlist from tvshows to episodes in XSP files, your skin will be faster to initialize. Can you just give a try ?

Maybe with Gotham and the use of this script :

http://forum.xbmc.org/showthread.php?tid=176864

http://forum.xbmc.org/showthread.php?tid=183504&pid=1612262#pid1612262

skins will be faster to load but skinners have to use it instead of this script. Aeon Nox 5 will do. As Aeon MQ5 is developped for a long time, don't know if Marcos will change the code.


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-14

(2014-02-13, 19:33)warlion Wrote: Hi all, mike thanks for you work on this script i just had a few question before i start changing a few lines

I'm porting Aeon Nox 4 to Gotham and when i try the widgets they are always populate only with movies and random it never take the current playlist I'm selecting, so my question, is this script working correct over Gotham ?
I'm just asking because i like to know if this is a skin problem or Gotham problem before i start looking over the code
Thanks
There is nothing wrong with this script and Aeon Nox 4 Gotham :

Image

Image

Image

You just have to remove
Code:
&quote;
from guisettings.xml for XSP file :

Before :

<setting type="string" name="skin.aeon.nox.gotham.SmartPlaylist1.Call">RunScript(script.randomandlastitems, type=Movie, playlist=&quote;special://profile/playlists/video/Parents.xsp&quote;, method=Last, limit=10, unwatched=True, resume=False, property=SmartPlaylist1)</setting>

After :

<setting type="string" name="skin.aeon.nox.gotham.SmartPlaylist1.Call">RunScript(script.randomandlastitems, type=Movie, playlist=special://profile/playlists/video/Parents.xsp, method=Last, limit=10, unwatched=True, resume=False, property=SmartPlaylist1)</setting>

Don't know if Gotham add this code when upgrading from Frodo.


RE: [RELEASE] Random and last items smartplaylist script for Skins - denywinarto - 2014-02-14

(2014-02-13, 16:51)mikebzh44 Wrote: With your MyVideos75.db, yours XSP files and your guisettings.xml, I can run XBMC the same way you do.

On my laptop PC at my office (Core [email protected] GHz - 4 Gb RAM but Win7 32bits so only 3 Gb available) from starting XBMC from desktop to getting all widgets populated, it took only 31 sec.

The only way to speed (a little) the script is to use smart playlist based on episodes and not on TV shows but when you enter custom menu based on episode smart playlists, you see only episodes, not TV shows and seasons :S

Or you can build 2 smart playlists for each menu : one based on TV shows for the custom menu action and one based on episodes for the widget. But I don't think that Ace cant handle one smart playlist for menu action and another for widget. Or you will have to edit home.xml to call the script with the right playlist :

guisettings.xml :

Code:
<setting type="string" name="skin.ace.vpl4.path">special://profile/playlists/video/Serial_Barat.xsp</setting>

home.xml :

Code:
    <onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl4.path)) + SubString(skin.string(mfvpl4_list),latest)">RunScript(script.randomandlastitems,limit=12,method=Last,playlist=special://profile/playlists/video/Serial_Barat_Episodes.xsp,menu=Menu34)</onload>
    <onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl4.path)) + SubString(skin.string(mfvpl4_list),random)">RunScript(script.randomandlastitems,limit=12,method=Random,playlist=special://profile/playlists/video/Serial_Barat_Episodes.xspmenu=Menu34)</onload>
    <onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl4.path)) + SubString(skin.string(mfvpl4_list),inprogress)">RunScript(script.randomandlastitems,limit=12,resume=True,method=Last,playlist=special://profile/playlists/video/Serial_Barat_Episodes.xsp,menu=Menu34)</onload>

I cannot speed up the script by removing _watchedOrResume function. Because you are using TV Shows smart playlist, JSON query return only TV Shows informations. So for gettings latest or random episodes from TV Shows smart playlist, the script have to execute extra JSON queries to get informations about seasons and episodes for each TV shows returned by first JSON query.

So, I think you have to deal with it (or by a more powerfull HTPC Tongue). And I think that when you will create your 30 custom menus based on 30 smart playlists, you will create a huge trafic jam with JSON query Big Grin

Mike, i think my TV shows already show episodes?

Image


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-14

No, for example serail_barat.xsp is a TV Shows smart playlist :

<smartplaylist type="tvshows">

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>



RE: [RELEASE] Random and last items smartplaylist script for Skins - denywinarto - 2014-02-14

(2014-02-14, 15:22)mikebzh44 Wrote: No, for example serail_barat.xsp is a TV Shows smart playlist :

<smartplaylist type="tvshows">

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>

What's the different btw? I only notice the widget is smaller..

Yes, it seems to be slightly faster now...
Although im not sure how fast it would be for 30 playlists Smile


RE: [RELEASE] Random and last items smartplaylist script for Skins - mikebzh44 - 2014-02-14

The difference is Episodes smart playlist display only episode, not TV Shows and Seasons.

Serial Barat - Episodes type :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>

When you enter Serail Barat menu, you arrive on episodes list with no TV shows or seasons informations :

Image

Serial Barat - TV Shows type :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>

When you enter Serail Barat menu, you arrive on TV Show level :

Image

Then on Season level or Episode level (if only one season is available and option is set in XBMC settings) :

Image


RE: [RELEASE] Random and last items smartplaylist script for Skins - warlion - 2014-02-14

Mike thanks so much for helping i will check the code to see where and why is adding the " thanks so much for you help


RE: [RELEASE] Random and last items smartplaylist script for Skins - denywinarto - 2014-02-15

(2014-02-14, 16:25)mikebzh44 Wrote: The difference is Episodes smart playlist display only episode, not TV Shows and Seasons.

Serial Barat - Episodes type :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>

When you enter Serail Barat menu, you arrive on episodes list with no TV shows or seasons informations :

Serial Barat - TV Shows type :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Serial Barat</name>
    <match>all</match>
    <rule field="path" operator="startswith">X:\</rule>
</smartplaylist>

When you enter Serail Barat menu, you arrive on TV Show level :

Then on Season level or Episode level (if only one season is available and option is set in XBMC settings) :

Thanks for the explanation Mike, i think i'm fine with this since i use favourites, not playlists to show tvshows.


RE: [RELEASE] Random and last items smartplaylist script for Skins - sveni_lee - 2014-02-15

(2014-02-14, 11:32)mikebzh44 Wrote: You just have to remove
Code:
&quote;
from guisettings.xml for XSP file :

Before :

<setting type="string" name="skin.aeon.nox.gotham.SmartPlaylist1.Call">RunScript(script.randomandlastitems, type=Movie, playlist=&quote;special://profile/playlists/video/Parents.xsp&quote;, method=Last, limit=10, unwatched=True, resume=False, property=SmartPlaylist1)</setting>

After :

<setting type="string" name="skin.aeon.nox.gotham.SmartPlaylist1.Call">RunScript(script.randomandlastitems, type=Movie, playlist=special://profile/playlists/video/Parents.xsp, method=Last, limit=10, unwatched=True, resume=False, property=SmartPlaylist1)</setting>

Don't know if Gotham add this code when upgrading from Frodo.

Hallo Mike,

I tried this but I have the problem that every time after a reboot it'd same as before...
I don't know why I can't remove
Code:
&quote;

Do you have any idea?


RE: [RELEASE] Random and last items smartplaylist script for Skins - warlion - 2014-02-15

Quit xbmc first


RE: [RELEASE] Random and last items smartplaylist script for Skins - sveni_lee - 2014-02-15

thanks...
that should work...