(2014-02-13, 13:00)mikebzh44 Wrote: @deny and other "Big library user".
I don't think that this script can be improved as Files.GetDirectory JSONRPC method does not support limits= parameters to reduce results :
http://wiki.xbmc.org/index.php?title=JSO...tDirectory
BTW, with your library, Deny, and Ace skin, as you use it, I have build a custom menu based on your Action.xsp file and script run in less than 5 seconds :
Code:
11:23:54 T:5512 DEBUG: Random and Last items script: ##### JSON BIG QUERY 4.457s
11:23:54 T:5512 DEBUG: Random and Last items script: ##### GLOBAL STATS DONE 4.465s
11:23:55 T:5512 DEBUG: Random and Last items script: ##### MOVIES PROPERTIES DONE 4.744s
11:23:55 T:5512 DEBUG: Random and Last items script: Loading PlaylistLastMovieMenu31 started at 2014-02-13 11:23:50 and take 4.750s
11:31:41 T:4464 DEBUG: Random and Last items script: ##### JSON BIG QUERY 4.628s
11:31:41 T:4464 DEBUG: Random and Last items script: ##### GLOBAL STATS DONE 4.633s
11:31:41 T:4464 DEBUG: Random and Last items script: ##### MOVIES PROPERTIES DONE 4.832s
11:31:41 T:4464 DEBUG: Random and Last items script: Loading PlaylistLastMovieMenu31 started at 2014-02-13 11:31:36 and take 4.835s
Times are cumulatives so running JSON query for Action.xsp file over entire library take 4,628s, scanning every 1205 movies to see if movie is watched or not, take 0,005s (4,633-4,628) and generating properties for 12 movies take 0,199s.
But, as you told me by MP, you have mod Ace skin to run 30 times the script because you have created 30 custom menus based on 30 smart playlists. As skin run 30 instances of script in parallel, you can understand that it can take a loooong time to load.
Can you try with standard Ace skin and just 4 / 5 custom menus ?
You can also use this randomandlastitems.py code (add some debug log), put XBMC in debug mode and rerun XBMC to see how long each script run :
https://www.dropbox.com/s/0cxa6aeqt09gah...stitems.py
I'm getting some error with that script...
http://xbmclogs.com/show.php?id=130411
Actually i haven't put in all 30 smart playlist codes into home.xml
(Only action movie playlist)
I will try it again once all 30 playlists are there
Btw i think i found a workaround after reading your PM
- remove this part
Code:
def _watchedOrResume ( _total, _watched, _unwatched, _result, _file ):
global RESUME
global UNWATCHED
_total += 1
_playcount = _file['playcount']
_resume = _file['resume']['position']
# Add Watched flag and counter for episodes
if _playcount == 0:
_file['watched']='False'
_unwatched += 1
else:
_file['watched']='True'
_watched += 1
if (UNWATCHED == 'False' and RESUME == 'False') or (UNWATCHED == 'True' and _playcount == 0) or (RESUME == 'True' and _resume != 0) and _file.get('dateadded'):
_result.append(_file)
return _total, _watched, _unwatched, _result
This will make movie playlists load faster, but it broke tvshow playlist
So what if we use separate randomandlastitem.py script with different name for tvshow?
Let's call it
randomandlastitem2, which is the unmodified version of your script
So in home.xml it will be like this maybe :
Code:
<!-- Ace -->
<window id="0">
<!--<defaultcontrol always="true">9000</defaultcontrol>-->
<allowoverlay>no</allowoverlay>
<include condition="!Skin.HasSetting(welcomedone5)">Startup</include>
<include condition="!Skin.HasSetting(fix5)">Quickfix</include>
<onunload condition="Skin.HasSetting(submode)">Close</onunload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl1.path)) + SubString(skin.string(mfvpl1_list),latest)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl1.path)],menu=Menu31)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl1.path)) + SubString(skin.string(mfvpl1_list),random)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Barat.xsp,menu=Menu31, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl2.path)) + SubString(skin.string(mfvpl2_list),latest)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl2.path)],menu=Menu32)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl2.path)) + SubString(skin.string(mfvpl2_list),random)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Asia.xsp,menu=Menu32, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl3.path)) + SubString(skin.string(mfvpl3_list),latest)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl3.path)],menu=Menu33)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl3.path)) + SubString(skin.string(mfvpl3_list),random)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Anime.xsp,menu=Menu33, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl4.path)) + SubString(skin.string(mfvpl4_list),latest)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl4.path)],menu=Menu34)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl4.path)) + SubString(skin.string(mfvpl4_list),random)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Serial_Barat.xsp,menu=Menu34, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl5.path)) + SubString(skin.string(mfvpl5_list),latest)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl5.path)],menu=Menu35)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl5.path)) + SubString(skin.string(mfvpl5_list),random)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Serial_Asia.xsp,menu=Menu35, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl6.path)) + SubString(skin.string(mfvpl6_list),latest)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(vpl6.path)],menu=Menu36)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(vpl6.path)) + SubString(skin.string(mfvpl6_list),random)">RunScript(script.randomandlastitems2,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Recommended_Serial_Anime.xsp,menu=Menu36, daemon=True)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(fav101.path)) + SubString(skin.string(mfvpl101_list),latest)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Last,playlist=$INFO[Skin.String(fav101.path)],menu=Menu101)</onload>
<onload condition="System.HasAddon(script.randomandlastitems) + !IsEmpty(skin.string(fav101.path)) + SubString(skin.string(mfvpl101_list),random)">RunScript(script.randomandlastitems,limit=12,stats=False,method=Random,playlist=special://masterprofile/playlists/video/Film_Action.xsp,menu=Menu101, daemon=True)</onload>
<onload condition="Player.HasAudio + System.HasAddon(script.artistslideshow)">RunScript(script.artistslideshow, daemon=True)</onload>
<onload condition="System.HasAddon(script.favourites) + SubString(skin.string(favourites.menu),on)">RunScript(script.favourites)</onload>
<controls>
<control type="multiimage" id="5043"><!-- Extra Fanart Song -->
<include>InvisibleButton</include>
<imagepath background="true">$INFO[Player.FolderPath,,../extrafanart/]</imagepath>
<visible>Player.HasAudio</visible>
</control>
<control type="multiimage" id="5044"><!-- Extra Fanart Artist -->
<include>InvisibleButton</include>
<imagepath background="true">$INFO[Skin.String(CustomMusicLogoPath)]$INFO[MusicPlayer.Artist,,/extrafanart/]</imagepath>
<visible>Player.HasAudio + IsEmpty(Control.GetLabel(5043))</visible>
</control>
<control type="multiimage">
<include>HomeBG</include>
<imagepath background="true">$INFO[Container(9000).ListItem.Icon]</imagepath>
</control>
<include>LiveBG</include>
<control type="group"><!-- default group -->
<include>Animation_Window</include>
<include condition="SubString(skin.string(menu_mode),alphabet)">MenuV</include>
<include condition="SubString(skin.string(menu_mode),genre)">MenuG</include>
<include>BGBlack</include>
</control>
</controls>
</window>
vpl4, vpl5, vpl6 are tvshows smart playlists, and they use randomandlastitem2.py
Is this possible?