i've been looking for a way to run the RecentlyAdded script in a more 'intelligent' way.
Running it everytime you enter the Home Screen if far from ideal, since many users are complaining it temporary locks up xbmc.
Using the new timer function to run the script every 30 minutes might also be overkill, since i only update my library once every few weeks.
Ideally, the script should only run once at startup and for the rest it should only run if the library has been updated.
To accomplish this, i've made the following changes to DialogMusicScan.xml and DialogVideoScan.xml:
[HTML]
<defaultcontrol>1111</defaultcontrol>
....
<control type="button" id="1111">
<posx>-10</posx>
<posy>-10</posy>
<height>1</height>
<width>1</width>
<texturefocus></texturefocus>
<texturenofocus></texturenofocus>
<onfocus>Skin.SetBool(LibraryUpdated)</onfocus>
</control>
[/HTML]
Next, in Startup.xml add a button to set a 'Startup' boolean:
[HTML]
<defaultcontrol always="true">10</defaultcontrol>
....
<control type="button" id="10">
<onfocus>Skin.SetBool(Startup)</onfocus>
<onfocus>ReplaceWindow(Home)</onfocus>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
</control>
[/HTML]
Finally, in Home.xml add three buttons:
[HTML]
<defaultcontrol always="true">5043</defaultcontrol>
....
<control type="button" id="5043">
<description>visible at startup</description>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<onfocus>XBMC.RunScript(special://skin/scripts/RecentlyAdded.py)</onfocus>
<onfocus>Skin.Reset(Startup)</onfocus>
<onfocus>SetFocus(9000)</onfocus>
<visible>Skin.HasSetting(Startup)</visible>
</control>
<control type="button" id="5043">
<description>visible after library update has finished</description>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<onfocus>XBMC.RunScript(special://skin/scripts/RecentlyAdded.py)</onfocus>
<onfocus>Skin.Reset(LibraryUpdated)</onfocus>
<onfocus>SetFocus(9000)</onfocus>
<visible>!Skin.HasSetting(Startup) + Skin.HasSetting(LibraryUpdated) + !Window.IsVisible(112) + !Window.IsVisible(133)</visible>
</control>
<control type="button" id="5043">
<description>visible in all other cases</description>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<onfocus>SetFocus(9000)</onfocus>
<visible>!Skin.HasSetting(Startup) + [!Skin.HasSetting(LibraryUpdated) | [Skin.HasSetting(LibraryUpdated) + [Window.IsVisible(112) | Window.IsVisible(133)]]]</visible>
</control>
[/HTML]
As far as i can tell this works like a charm, but maybe i've missed something?
Any feedback is appreciated.
[RELEASE] RecentlyAdded Script (RecentlyAdded.py) Recently Added for Skins / Skinners
ronie
Team-XBMC Member Joined: Jan 2009 Reputation: 108 |
2009-08-30 16:49
Post: #21
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2009-08-30 21:55 by ronie.)
|
| find quote |
Hitcher
Skilled Skinner Joined: Aug 2007 Reputation: 67 Location: Eastleigh, UK |
2009-08-30 17:22
Post: #22
Sounds a much better way of running it, thanks Ronie I'll give it a go.
![]() |
| find quote |
CF2009
Alaska Group Posts: 289 Joined: Mar 2009 Location: UK |
2009-08-30 17:30
Post: #23
nice i did not think of using DialogMusicScan.xml and DialogVideoScan.xml like that...
Will this work if i use suspend as i do not shutdown my MC? one thing to note is that the watched totals will not update unto you restart ![]() |
| find quote |
ronie
Team-XBMC Member Joined: Jan 2009 Reputation: 108 |
2009-08-30 19:26
Post: #24
ronie Wrote:but maybe i've missed something? i've obviously forgot a way to reset the 'NotStartup' boolean when you quit xbmc. this can by done by adding <onclick>Skin.Reset(NotStartup)</onclick> to the appropriate buttons (exit/shutdown/restart/reboot) in DialogButtonMenu.xml.....but this won't work for users who bypass the shutdown menu by mapping these functions to their remote. So, maybe it's better to use something like this instead: [HTML]<onfocus>SetProperty(NotStartup,1)</onfocus> <visible>IsEmpty(Window(Home).Property(NotStartup))</visible>[/HTML] I'll have to do some more testing to check if this would work as expected. edit: the easiest way to clear the 'NotStartup' boolean, is doing it at startup. add this to Startup.xml: [HTML] <defaultcontrol always="true">10</defaultcontrol> .... <control type="button" id="10"> <onfocus>Skin.Reset(NotStartup)</onfocus> <onfocus>ReplaceWindow(Home)</onfocus> <texturenofocus>-</texturenofocus> <texturefocus>-</texturefocus> </control> [/HTML] i've updated the previous post to include this change. CF2009 Wrote:Will this work if i use suspend as i do not shutdown my MC? I can't think of any reason why it shouldn't, but there's only one way to find out. ;-) Always read the XBMC online-manual, FAQ and search the forum before posting. Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2009-08-30 21:56 by ronie.)
|
| find quote |
mnegrisoli
Junior Member Posts: 29 Joined: Jul 2009 Reputation: 0 Location: Brasil / SC |
2009-11-09 15:08
Post: #25
Hi everybody !
I´ve tried to change this script for show in recently added tv show backdrop a Fanart from parent show instead of "stretched" thumb. How can I do this ? I suspect that this is the line for this change .... Code: self.WINDOW.setProperty( "LatestEpisode.%d.Fanart" % ( count + 1, ), "special://profile/Thumbnails/Video/%s/%s" % ( "Fanart", fanart_cache, ) )Thanks ! |
| find quote |
Hitcher
Skilled Skinner Joined: Aug 2007 Reputation: 67 Location: Eastleigh, UK |
2009-11-09 17:33
Post: #26
Cheers for bumping this, I'll add it to Alaska.
![]() |
| find quote |
Hitcher
Skilled Skinner Joined: Aug 2007 Reputation: 67 Location: Eastleigh, UK |
2009-11-09 17:47
Post: #27
mnegrisoli Wrote:Hi everybody !You'll have to change the skin not the script to get fanart to show. ![]() |
| find quote |
mnegrisoli
Junior Member Posts: 29 Joined: Jul 2009 Reputation: 0 Location: Brasil / SC |
2009-11-10 15:19
Post: #28
Thanks Hitcher ...
Is the file Includes_Latest_Added.xml ? Maybe in this line ? Code: <control type="image">I´m using Aeon Hiched ![]() Thanks |
| find quote |
Hitcher
Skilled Skinner Joined: Aug 2007 Reputation: 67 Location: Eastleigh, UK |
2009-11-10 17:54
Post: #29
That looks like the one.
Just change Thumb to Fanart. ![]() |
| find quote |
mnegrisoli
Junior Member Posts: 29 Joined: Jul 2009 Reputation: 0 Location: Brasil / SC |
2009-11-10 18:44
Post: #30
Cool !
I´m try when in home .... Thanks again Hitcher ! Hitcher Wrote:That looks like the one. |
| find quote |


![[Image: sig_zps3af3b48e.jpg]](http://i620.photobucket.com/albums/tt289/Arcanthur/Celestium/sig_zps3af3b48e.jpg)
![[Image: problem_solved.png]](http://i268.photobucket.com/albums/jj4/Og_one/problem_solved.png)

Search
Help