Might be worth posting what we are trying to do, in case someone with the answer looks at this thread.
Basically plexbmc uses /library/onDeck and /library/recentlyAdded endpoints, which contain a mixed list from each section you have, the current main branch has fixed it so that the items only show on the correct shelves rather than all shelves.
I have started a branch to try and use the /library/sections/sectionid/onDeck and /library/sections/sectionid/recentlyAdded endpoints instead as this allows us to get recently added for the music section among others as well.
The issue with this is best illustrated by an example.
A user has 4 video sections:
Movies
Kids Movies
Home Movies
Adult Movies
The script currently gets 25 items, for each section = 100 items.
The skin currently has support for up to 50 items.
Each item is stored similar to below (not the full code, just an example to give an idea)
Code:
movieCount=1
for index in sorted(added_list, reverse=direction):
media=added_list[index][0]
libuuid = added_list[index][4]
if media.get('type',None) == "movie":
WINDOW.setProperty("Plexbmc.LatestMovie.%s.Path" % movieCount, m_url)
WINDOW.setProperty("Plexbmc.LatestMovie.%s.Title" % movieCount, media.get('title','Unknown').encode('UTF-8'))
WINDOW.setProperty("Plexbmc.LatestMovie.%s.uuid" % movieCount, libuuid.encode('UTF-8'))
movieCount += 1
The skin then basically says (as I understand it):
if (Plexbmc.LatestMovie.1.uuid == currentsectionUUID) display item
Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.1.Path))</visible>
<visible>StringCompare(Container(300).ListItem.Property(uuid),Window(Home).Property(Plexbmc.LatestMovie.1.uuid))</visible>
if (Plexbmc.LatestMovie.2.uuid == currentsectionUUID) display item
Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.2.Path))</visible>
<visible>StringCompare(Container(300).ListItem.Property(uuid),Window(Home).Property(Plexbmc.LatestMovie.2.uuid))</visible>
etc all the way up to 50
my suggestion was to change it in plexbmc to
Code:
WINDOW.setProperty("Plexbmc.LatestMovie.%s.%s.Path" % (libuuid, sectionCount), m_url)
then in the skin ditch the check and use
Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].1.Path))</visible>
Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].2.Path))</visible>
However that would be written (basically the uuid is gathered from Container(300).ListItem.Property(uuid)] and used to get the correct item), but I know nothing of skinning and apparently that isn't possible, so we are back to the drawing board on that one
As well as that we need it as light as possible, so instead of having 50 items even if none are available pecinko wandered if it was possible to dynamically generate the items to pass to the skin, so instead of 50 lots of:
Code:
<item id="1" description="Movies">
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.1.Path))</visible>
<visible>StringCompare(Container(300).ListItem.Property(uuid),Window(Home).Property(Plexbmc.LatestMovie.1.uuid))</visible>
<label>$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Title)][COLOR=White]$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Year), • ]$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Rating), • ]$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Duration), • , $LOCALIZE[31297]][/COLOR] $INFO[Window(Home).Property(Plexbmc.LatestMovie.1.uuid)]</label>
<thumb>$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Thumb)]</thumb>
<property name="ItemType">$LOCALIZE[31961]</property>
<onclick>PlayMedia($ESCINFO[Window(Home).Property(Plexbmc.LatestMovie.1.Path)])</onclick>
</item>
get them generated in python dynamically and just have the skin output the result.