PleXBMC add-on / skin integration support

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Lightbulb  PleXBMC add-on / skin integration support
Post: #1
Please post any questions regarding PleXBMC add-on support/integration in Amber skin here.


PleXBMC repo: https://github.com/hippojay/plugin.video.plexbmc
= XBMC client for Plex Media Server =

My skins:

Amber
Quartz

(This post was last modified: 2014-04-15 12:41 by pecinko.)
find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #2
I spoke to Martijn, he said he doesn't have any knowledge of skinning so isn't sure about having dynamic content in a listcontainer, but thinks maybe the tv show next aired script might work like that, I'm having a look

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #3
Latest code of plexbmc that can be found on KodeStar's GitHub repo brings improvements for the shelf items. Shelf items are no longer mixed but sorted per library section!

You will need latest (GitHub) version of Amber in order to make most use of this changes.

(2013-10-18 11:18)Kode Wrote:  I spoke to Martijn, he said he doesn't have any knowledge of skinning so isn't sure about having dynamic content in a listcontainer, but thinks maybe the tv show next aired script might work like that, I'm having a look

OK. Post your findings and I will think about possible alternatives in the meantime.

My skins:

Amber
Quartz

(This post was last modified: 2013-10-18 11:19 by pecinko.)
find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #4
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(Pl​exbmc.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(Pl​exbmc.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(Pl​exbmc.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.

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
(This post was last modified: 2013-10-18 16:12 by Kode.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #5
(2013-10-18 12:02)Kode Wrote:  my suggestion was to change it to
WINDOW.setProperty("Plexbmc.LatestMovie.%s.%s.Path" % (libuuid, sectionCount), m_url)

then in the skin ditch the check and use
- <visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].1.Path))</visible>
- <visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].2.Path))</visible>

However that would be written, but I know nothing of skinning and apparently that isn't possible, so we are back to the drawing board on that one

Let me try to translate it to english

List item = WINDOW.setProperty("Plexbmc.LatestMovie.libuuid.library_section_number.Path"

visible condition = This item in the List is visible IF currently focused Main Menu Item HAS assigned property UUID (property is not empty). Last part ".1.Path" should be removed.

(2013-10-18 11:18)Kode Wrote:  I spoke to Martijn, he said he doesn't have any knowledge of skinning so isn't sure about having dynamic content in a listcontainer, but thinks maybe the tv show next aired script might work like that, I'm having a look

About skin support - here's a quick highlight about skinning:

XBMC uses windows and dialogs they are represented by separate XML files. Each window contains a set of controls - lists, buttons or other objects that are rendered in order of appearance. List are containers that can have multiply items. First part of list controls defines it's own layout and orientation <content> part contains a STATIC list of items that container will hold. Controls with reserved IDs are "skinned" only to define layout and interaction to other objects (navigation) while their content is supplied dynamically by XBMC.

Every control in a window is visible (rendered) unless explicitly hidden. Visibility is defined by conditions. Conditions are mostly checked every frame and come with a speed penalty. Some conditions are more time expensive then others.

My skins:

Amber
Quartz

(This post was last modified: 2013-10-18 12:18 by pecinko.)
find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #6
pecinko, that bit you quoted was my attempt at breaking the items up, which wouldn't work, but you are misinterpretting it, what I was saying was use

Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.1.Path = "movie1"
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.2.Path = "movie2"

Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.1.Path = "kids movie1"
Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.2.Path = "kids movie2"

then do

Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].1.Path))</visible>
rest of item 1 display bits

Code:
<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.[Container(300).ListItem.Property(uuid)].2.Path))</visible>
rest of item 2 display bits

where when you were in the movie section would be equivelant to

<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.1.Path))</visible><visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.2.Path))</visible>

and in the kids section would be

<visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.1.Path))</visible><visible>!IsEmpty(Window(Home).Property(Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.2.Path))</visible>

because the librayuuid (aaaa-aaaa-aaaa-aaaa) comes from Container(300).ListItem.Property(uuid), but I don't know how to express that, probably because, as you have said, it's not possible to do it that way, I've put it up there in case someone knows of a solution.

Then instead of matching every item against a particular library uuid, you would be explicitly getting all the items for the particular library uuid

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
(This post was last modified: 2013-10-18 12:32 by Kode.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #7
1. What we have now is a Main list (Container ID="300") that contains library sections (Main menu items - Movies 1, Movies 2, TV Shows, Music 1, Music2). Each Main menu item has a unique UUID that.

PHP Code:
$INFO[Window(Home).Property(plexbmc.0.title)] 

2. We have recently added shelf items (Container ID="311") populated (50 at the moment) and each has UUID assigned, so we know to which section of the library (or Main menu item if you want) they belong.

PHP Code:
$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Title)] 

Problem - with several library sections we are likely hitting 50 item limit in Container=311. Furthermore, expensive visibility check is being used - StringCompare for EACH of those 50 items.

Agreed so far?

My skins:

Amber
Quartz

(This post was last modified: 2013-10-18 12:40 by pecinko.)
find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #8
yes completely understand how it's currently working Smile

*edit*
And if my suggestion worked, it would completey get rid of the need to do the check, and you would only need to have say 25 items, but as I understand it from what you are saying, it's not possible to put the variable in the request, i.e. in PHP you could do something like:

Code:
// $libraryuuid = "aaaa-aaaa-aaaa-aaaa";
if(!empty($variable["plexbmc"]["latestEpisode"][$libraryuuid][1]["title"])) {
    // Do stuff
}

But from my take on what you are saying that wouldn't be possible within the skin, which is fine, I understand that, I don't know enough about skinning to propose a solution, so I put my thinking there in case someone else could think of a solution.

If it was possible to use

Code:
$INFO[Window(Home).Property(Plexbmc.LatestMovie.$INFO[Window(Home).Property(plexbmc.0.title)].1.Title)]

all our problems would be solved

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
(This post was last modified: 2013-10-18 12:51 by Kode.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #9
(2013-10-18 12:33)pecinko Wrote:  1. What we have now is a Main list (Container ID="300") that contains library sections (Main menu items - Movies 1, Movies 2, TV Shows, Music 1, Music2). Each Main menu item has a unique UUID that.

PHP Code:
$INFO[Window(Home).Property(plexbmc.0.title)] 

2. We have recently added shelf items (Container ID="311") populated (50 at the moment) and each has UUID assigned, so we know to which section of the library (or Main menu item if you want) they belong.

PHP Code:
$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.Title)] 

Problem - with several library sections we are likely hitting 50 item limit in Container=311. Furthermore, expensive visibility check is being used - StringCompare for EACH of those 50 items.

Agreed so far?

(2013-10-18 12:37)Kode Wrote:  yes completely understand how it's currently working Smile

Great!

Now, if we fetch first 10 items from each movie section we hit the limit on 6th section. OTOH, if we increase number of items we will likely slow down skin significantly.

We need a way to increase number of items but we must use a better visibility check. And, we are talking only about Recently added here, OnDeck would add additional overhead to skin engine.

How many items would you like to have on shelf? What htpc are you using?

My skins:

Amber
Quartz

(This post was last modified: 2013-10-18 13:12 by pecinko.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #10
(2013-10-18 12:37)Kode Wrote:  If it was possible to use

Code:
$INFO[Window(Home).Property(Plexbmc.LatestMovie.$INFO[Window(Home).Property(plexbmc.0.title)].1.Title)]

all our problems would be solved

Could you elaborate a bit here?

Isn't this the same as

$INFO[Window(Home).Property(Plexbmc.LatestMovie.UUID.1.Title)]

Of what help would this be to us? We already have this, don't we? 50 items with unique UUIDs.

My skins:

Amber
Quartz

(This post was last modified: 2013-10-18 13:17 by pecinko.)
find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #11
we dont have

$INFO[Window(Home).Property(Plexbmc.LatestMovie.UUID.1.Title)]

we have

$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.uuid)]
$INFO[Window(Home).Property(Plexbmc.LatestMovie.1.title)]

if we had $INFO[Window(Home).Property(Plexbmc.LatestMovie.UUID.1.Title)]

then we would only have 25 items, because plexbmc only creates 25 items within Plexbmc.LatestMovie.UUID

so in effect with 4 sections, we would have 4 lists of 25 items, rather than the current 1 list of 100 items. look at it like this:

Imagine plexbmc only did 5 per section instead of 25

with 2 sections you would have

Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.1.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.2.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.3.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.4.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.5.Title

Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.1.Title
Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.2.Title
Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.3.Title
Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.4.Title
Plexbmc.LatestMovie.bbbb-bbbb-bbbb-bbbb.5.Title

so $INFO[Window(Home).Property(plexbmc.0.uuid)] which would be the same as "aaaa-aaaa-aaaa-aaaa" in the first section would only have 5 items, not 10

because the only items that are within the Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa namespace are:
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.1.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.2.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.3.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.4.Title
Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa.5.Title

And because you are listing all the Plexbmc.LatestMovie.aaaa-aaaa-aaaa-aaaa items you dont have to check if the uuid is correct because it wouldnt be listed if it wasn't

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
(This post was last modified: 2013-10-18 13:31 by Kode.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #12
Finally checked you branch and it is looking good here!

Only problem I see is that Recently added shelf is not stacked anymore - I have episodes instead of Seasons?

My skins:

Amber
Quartz

find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #13
really? It was showing stacked for me, although it was 2am by the time I finished, although in all honesty episodes would probably be better, I found it confusing having Southpark Season 17 show up 2 or 3 times, same with most of them as they are weekly shows and so show up multiple times before the 25 limit is hit.

I haven't made any changes to show episodes instead of seasons that I know of, but I will double check.

*edit* only thing I can think of is the output from /library/onDeck is different from /library/sections/tvsection/onDeck where 1 returns seasons and the other returns episodes?

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
(This post was last modified: 2013-10-18 13:49 by Kode.)
find quote
pecinko Offline
Donor
Posts: 3,795
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #14
(2013-10-18 13:47)Kode Wrote:  really? It was showing stacked for me, although it was 2am by the time I finished, although in all honesty episodes would probably be better, I found it confusing having Southpark Season 17 show up 2 or 3 times, same with most of them as they are weekly shows and so show up multiple times before the 25 limit is hit.

I haven't made any changes to show episodes instead of seasons that I know of, but I will double check.

I'm testing with caching OFF and it really shows episodes.

We should use Seasons (stacked) to save items. You may have added 2 seasons of Southpark? But then it should show Southpark Season 16 and Southpark Season 17. If it does not then it's a regression in plexbmc. If season labels are not showing properly I will fix it in a skin.

My skins:

Amber
Quartz

find quote
Kode Offline
fanart.tv admin
Posts: 750
Joined: Mar 2010
Reputation: 14
Post: #15
How do you turn caching off? I will try it tonight.

The only real difference I've made is get all the sections, then if the section is artist/movie/show use the path as the endpoint with /onDeck or /recentlyAdded on the end, if it isn't one of those sections ignore it (otherwise we get blank overlays on all the sections).

If any stacking is done it must be done within the feed as I don't see any explicit stacking in the code, have a look at library/recentlyAdded and library/sections/tvsectionid/recentlyAdded and see if it gives different output.

Get and request your ClearLOGOs / ClearART / TV Thumbs / Season Thumbs / Music ClearLOGOs / cdART / Artist Backgrounds / CD Covers from fanart.tv

Severus Server Monitor - Self hosted application to monitor all your servers
find quote
Post Reply