Is this advanced Home Screen View Mod function idea possible in XBMC Skinning-Engine?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #46
Nuka1195 Wrote:here is the final version. native support would be better.

http://xbmc-addons.googlecode.com/svn/pa...lyAdded.py

you can call the script with params. all params are optional

eg
Code:
<onfocus>XBMC.RunScript(special://home/scripts/RecentlyAdded.py,limit=3&amp;albums=$INFO[Skin.HasSetting(showalbums)]&amp;partial=$INFO[Skin.HasSetting(showpartialviewed)])</onfocus>

limit = the number of items to set(default=5)

albums = True to display the most recent music albums(default = show most recent songs)

partial = show the videos that have not been finished, but have started

*albums, the path is still set to an individual song as i don't know how to make PlayMedia play an album

**partial, PlayMedia does not support resume, so the video will start from the beginning

skinners you can have settings for these as shown in my example. the setting must be True when selected.

i cant seem to get last albums working, ihave last songs working great but, if i have the albums=true i still just gets songs, this means that if i add 6 albums it still only displays the 6 songs from last album. can you tell me where am going wrong ? here is the code i'm using
Code:
    <include name="latest_added">
        <control type="button" id="500">
            <texturefocus>-</texturefocus>
            <texturenofocus>-</texturenofocus>
            <onclick>-</onclick>
            <label>-</label>
            <posy>-100</posy>
            <posx>0</posx>
            <onfocus>XBMC.RunScript(special://skin/extras/RecentlyAdded.py,limit=6&amp;albums=True])</onfocus>
            <onfocus>SetFocus(300)</onfocus>
        </control>

    <!--Latest Music-->
        <control type="list" id="510">
            <visible>Container(300).HasFocus(1) + !Skin.HasSetting(noweatherpopup) + Skin.HasSetting(homelatest)</visible>

            <posx>50</posx>
            <posy>40</posy>
            <width>1190</width>
            <height>287</height>
            <scrolltime>600</scrolltime>
            <orientation>horizontal</orientation>
            <focusposition>0</focusposition>

            <onup>300</onup>
            <ondown>300</ondown>
            <onleft>510</onleft>
            <onright>510</onright>

            <animation effect="slide" start="0,-20" end="0,-20" time="0" condition="!Skin.HasSetting(highertime)">Conditional</animation>
            <animation effect="zoom" start="100" end="90" time="200" center="640,80" condition="Player.HasAudio + Skin.HasSetting(lowermainmenu)">Conditional</animation>
            <animation effect="fade" start="0" end="100" time="500">WindowOpen</animation>
            <animation effect="fade" start="100" end="0" time="200">WindowClose</animation>

            <animation effect="fade" start="0" end="100" delay="800" time="400">Visible</animation>
            <animation effect="fade" start="100" end="0" time="200">Hidden</animation>


            <itemlayout width="198" height="287">
                <control type="image">
                    <posy>0</posy>
                    <width>190</width>
                    <height>237</height>
                    <texture>home/home_weather_big.png</texture>
                </control>
                <control type="label">
                    <posx>95</posx>
                    <posy>-7</posy>
                    <width>170</width>
                    <height>50</height>
                    <align>center</align>
                    <aligny>center</aligny>
                    <font>Font_LatestAdditionsTiles</font>
                    <textcolor>c0FFFFFF</textcolor>
                    <wrapmultiline>true</wrapmultiline>
                    <scrollspeed>30</scrollspeed>
                    <label>[UPPERCASE]$INFO[ListItem.label][/UPPERCASE]</label>
                </control>
                <control type="label">
                    <posx>95</posx>
                    <posy>28</posy>
                    <width>170</width>
                    <height>20</height>
                    <align>center</align>
                    <aligny>center</aligny>
                    <font>Font_LatestAdditionsYear</font>
                    <textcolor>c0FFFFFF</textcolor>    
                    <label>[UPPERCASE]$INFO[ListItem.label2][/UPPERCASE]</label>
                </control>
                <control type="image">
                    <texture diffuse="multiplex/multiplex_mask.png">$INFO[ListItem.icon]</texture>
                    <posx>20</posx>
                    <posy>70</posy>
                    <width>150</width>
                    <height>150</height>
                </control>
            </itemlayout>
            <focusedlayout width="198" height="287">
                <control type="image">
                    <posy>0</posy>
                    <width>190</width>
                    <height>237</height>
                    <texture>home/home_weather_big.png</texture>
                </control>
                <control type="label">
                    <posx>95</posx>
                    <posy>-7</posy>
                    <width>170</width>
                    <height>50</height>
                    <align>center</align>
                    <aligny>center</aligny>
                    <font>Font_LatestAdditionsTiles</font>
                    <textcolor>FFFFFFFF</textcolor>    
                    <wrapmultiline>true</wrapmultiline>
                    <scrollspeed>30</scrollspeed>
                    <label>[UPPERCASE]$INFO[ListItem.label][/UPPERCASE]</label>
                </control>
                <control type="label">
                    <posx>95</posx>
                    <posy>28</posy>
                    <width>170</width>
                    <height>20</height>
                    <align>center</align>
                    <aligny>center</aligny>
                    <font>Font_LatestAdditionsYear</font>
                    <textcolor>FFFFFFFF</textcolor>    
                    <label>[UPPERCASE]$INFO[ListItem.label2][/UPPERCASE]</label>
                </control>
                <control type="image">
                    <texture diffuse="multiplex/multiplex_mask.png">$INFO[ListItem.icon]</texture>
                    <posx>20</posx>
                    <posy>70</posy>
                    <width>150</width>
                    <height>150</height>
                </control>
            </focusedlayout>
            <content>
                <item>
                    <label>$INFO[Window.Property(LatestSong.1.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.1.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.1.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.1.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.1.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.1.Album))</visible>
                </item>
                <item>
                    <label>$INFO[Window.Property(LatestSong.2.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.2.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.2.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.2.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.2.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.2.Album))</visible>
                </item>
                <item>
                    <label>$INFO[Window.Property(LatestSong.3.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.3.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.3.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.3.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.3.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.3.Album))</visible>
                </item>
                <item>
                    <label>$INFO[Window.Property(LatestSong.4.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.4.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.4.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.4.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.4.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.4.Album))</visible>
                </item>
                <item>
                    <label>$INFO[Window.Property(LatestSong.5.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.5.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.5.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.5.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.5.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.5.Album))</visible>
                </item>
                <item>
                    <label>$INFO[Window.Property(LatestSong.6.Album)]</label>
                    <label2>$INFO[Window.Property(LatestSong.6.Artist)]</label2>
                    <onclick>$INFO[Window.Property(LatestSong.6.Path),PlayMedia(,)]</onclick>
                    <Fanart>$INFO[Window.Property(LatestSong.6.Fanart)]</Fanart>
                    <thumb>$INFO[Window.Property(LatestSong.6.Thumb)]</thumb>
                    <visible>!IsEmpty(Window.Property(LatestSong.6.Album))</visible>
                </item>
            </content>
        </control>

    </include>
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #47
@andyblac

PHP Code:
<onfocus>XBMC.RunScript(special://skin/extras/RecentlyAdded.py,limit=6&amp;albums=True)</onfocus> 

@dt1000, some thumbs not showing. are these stacked movies? on a share with a username/password in the path?

maybe try the onfocus before the onclick if the path and filename is right? try the actual path to test not the special:// path.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #48
Nuka1195 Wrote:@andyblac

PHP Code:
<onfocus>XBMC.RunScript(special://skin/extras/RecentlyAdded.py,limit=6&amp;albums=True)</onfocus> 

@dt1000, some thumbs not showing. are these stacked movies? on a share with a username/password in the path?

maybe try the onfocus before the onclick if the path and filename is right? try the actual path to test not the special:// path.

vdrfan told me that the python getcachethumb stuff doesn't seem to work for rar'd content he was going to fix it in the source but is at linuxtag / devcon
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #49
[quote=Nuka1195]@andyblac

PHP Code:
<onfocus>XBMC.RunScript(special://skin/extras/RecentlyAdded.py,limit=6&amp;albums=True)</onfocus> 

Thanks Smile that extra ] the pesky thing
(This post was last modified: 2009-06-28 02:26 by andyblac.)
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #50
last update Smile

this will fix no thumbs for those videos that had a username/password in the path.

if your issue is rar paths, then as jezz mentioned it will be fixed by team xbmc.

this is the final update, unless xbmc will not have native support (it should) and you want music videos and maybe an option to filter watched items.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
KidKiwi Offline
Posting Freak
Posts: 831
Joined: May 2007
Reputation: 0
Post: #51
Nuka1195 Wrote:**partial, PlayMedia does not support resume, so the video will start from the beginning

Be nice if resume was a function. If this is added to xbmc base, then perhaps this WILL become a possibility. I've personally wanted such a feature for years.

I really love the great work that takes place on this forum. Cool

ZOTAC IONITX-D-E Intel Atom N330 Dual Core 1.6 GHz NVIDIA ION with LIVE on SSD
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #52
KidKiwi Wrote:Be nice if resume was a function. If this is added to xbmc base, then perhaps this WILL become a possibility. I've personally wanted such a feature for years.

I really love the great work that takes place on this forum. Cool

this is allready added to the xbmc its just the inside skin and script PlayMedia Command doesn't use it. Resume has been possible from the file lists for ages
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Information  Feature request for native support needed on trac for tracking purposes...
Post: #53
XBMCG33K Wrote:
Nuka1195 Wrote:
Gamester17 Wrote:Is there anyway to get this supported nativly in XBMC's skinning-engine, without using python?

Someone submit a request on trac for it? Confused
native support would be better.
wonder if it can be added to the actual engine? Be available for all?
Can a skinner who want to have a feature like this for their skin(s) please submit a feature request for it on trac?
http://trac.xbmc.org/

Then please post a link to that trac ticket here so that other skinners can add information to it.

Thank you in advance! Nod

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not 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-06-28 15:49 by Gamester17.)
find quote
Feanor Offline
Senior Member
Posts: 113
Joined: Apr 2009
Reputation: 0
Post: #54
This looks great!
To anyone that got this working, what are the steps to do so?
Download the python script, place it somewhere... then? where and how do we add the code to call the script? I specially like your implementation jezz!

Thanks to anyone that can help a noob Smile
find quote
dt1000 Offline
Member
Posts: 71
Joined: May 2009
Reputation: 4
Post: #55
Mission accomplished!
I've got everything working pretty much as intended. Big Grin

You can download the MediaStream hack here.

Just unzip the file to your XBMC directory and it will add Latest Movies & Latest TV panels to mediastream. Don't forget... you will have to activate them from the skin settings to see anything!

Items of note...
  • I've modified the script a bit to do a couple of extra things.
    - Firstly it only grabs unwatched files as the default.
    - Secondly it groups TV episodes by series (some tricky SQL was needed to get this working properly - it will break on the rare condition that 2 episodes have the same air date and they are episodes 9 and 10).
    - Thirdly it clears the filenames for the first four TV & movie entries. Why? Well I use the filenames to determine the visibility of list items and if you watch a movie and your number of new items drops below four you need to flush the old data otherwise the menu still contains the old info on refreshing.
    Nuka, you might want to take a look at this as my code is pretty hacky (I've never used Python or SQL before).
  • I got the auto-refresh working by adding a button like Jezz_X suggested. You also have to alter the window's <defaultcontrol> to get it to focus on the new button as the default. Also, only buttons can have the <onfocus> tag applied to them.
  • Some pictures just don't work. It's most strange and I can't work out why as there doesn't seem to be any pattern. I've added a static image as a default for when this happens so it still looks OK. If anyone can work out why this is happening that would be great.

Anyway, I've had a lot of fun getting this to work - thanks for all your awesome help! Let me know if you enjoy the mod (or spot any problems...)

Cool
(This post was last modified: 2009-06-29 00:10 by dt1000.)
find quote
Feanor Offline
Senior Member
Posts: 113
Joined: Apr 2009
Reputation: 0
Post: #56
Thanks dt1000!
I've downloaded and extracted the files, but it doesn't seem to work.
I get the home screen, but it's all black, I don't have backgrounds for any item in the menu, and don't have the latest items either...
find quote
Feanor Offline
Senior Member
Posts: 113
Joined: Apr 2009
Reputation: 0
Post: #57
Actually, I forgot to enable it from the options, now it works... but I still have no background images for the items in the home menu... any ideas?
find quote
eseph Offline
Junior Member
Posts: 16
Joined: Jun 2009
Reputation: 0
Post: #58
Feanor Wrote:Thanks dt1000!
I've downloaded and extracted the files, but it doesn't seem to work.
I get the home screen, but it's all black, I don't have backgrounds for any item in the menu, and don't have the latest items either...
Exactly the same here aswell... Luckily I backed up my settings.
find quote
dt1000 Offline
Member
Posts: 71
Joined: May 2009
Reputation: 4
Post: #59
Damn! I must have carried over some other tweaks from when I was mucking around with backgrounds...
I'll take a look at it this afternoon and fix it. Smile

Thanks for letting me know.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #60
ok final update (maybe)

i added an "unplayed" arg (affects music and videos)

PHP Code:
unplayed=$INFO[Skin.HasSetting(showunplayed)] 

i also clear the properties.

thanks dt1000

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Post Reply