Hack to Show Season Poster on Episode Level
#1
Hello

Im trying to finde a Hack to Show Season Poster on Episode Level.

At the Moment i try it like this (see below), but got problems to tell XBMC where to look for the season Poster.

my atempts:
PHP Code:
<texture background="true">$VAR[Seasonposter]</texture
in Variables.xml:
PHP Code:
<variable name="Seasonposter">    
    <
value condition="StringCompare(ListItem.Season,1)">ListItem.FolderPath,season01-poster.jpg</value>
    <
value condition="StringCompare(ListItem.Season,2)">ListItem.Path,season02-poster.jpg</value>
    <
value condition="StringCompare(ListItem.Season,3)">$INFO[ListItem.FolderPath,season03-poster.jpg]</value>
</
variable

Would be cool if someone could help a liddle.
Reply
#2
I'm guessing the problem is that FolderPath is giving you the path to the Season folder -- for example: Tvshows/BreakingBad/Season01 -- when the season posters are in the tvshow folder. You could try the following...
Code:
$INFO[ListItem.FolderPath,,../season01-poster.jpg]

But that will cause issues if the episodes are not in separate season folders. You could also set a string that points to where your tvshows are stored and ensure that every tv show matches its name in the library
Code:
$INFO[Skin.String(tvshowspath)]$INFO[ListItem.TvShowTitle,,/season01-poster.jpg]


Also, note my comma usage in $INFO tags. Anything after the first comma goes before the tag and after the 2nd goes after that tag. e.g.
Code:
$INFO[ListItem.Label,foo,bar]
gives you
Code:
fooBreaking Badbar
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Doesn't Container.SeasonThumb work?
Reply
#4
(2014-03-20, 14:46)Hitcher Wrote: Doesn't Container.SeasonThumb work?

Hasn't worked since Frodo afaik and ListItem.Art(season.poster) only works in DialogVideoInfo
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
@jurialmunkey

Thanks so far, did try both with no luck. Thanks for the hint with the comma, this and what the numbers of points does is someting which i try to understand (comma seems clear now, thanks)
attempts so far:
PHP Code:
<variable name="Seasonposter">    
    <
value condition="StringCompare(ListItem.Season,1)">$INFO[ListItem.FolderPath,season01-poster.jpg]</value>
    <
value condition="StringCompare(ListItem.Season,2)">$INFO[ListItem.Path,season02-poster.jpg]</value>

    <
value condition="StringCompare(ListItem.Season,3)">$INFO[ListItem.FolderPath,,../season03-poster.jpg]</value>
    <
value condition="StringCompare(ListItem.Season,5)">$INFO[Skin.String(tvshowspath)]$INFO[ListItem.TvShowTitle,,/season05-poster.jpg]</value>

    <
value condition="StringCompare(ListItem.Season,6)">$INFO[sources://video/,season06-poster.jpg]</value>
    
<value condition="StringCompare(ListItem.Season,7)">sources://video/tvshows/Skin.String(tvshowspath)/season07-poster.jpg]</value>
    
<value condition="StringCompare(ListItem.Season,8)">$INFO[ListItem.Path,,season02-poster.jpg]</value>
</
variable
if i could jump one step down from Listitem.Path i would be in the right directory, i guess.

EDIT: did try to show "Skin.String(tvshowspath)" as a label, but it shows me nothing.

------
@Hitcher:

Did try "Container.SeasonThumb" instead of $VAR[foo] with no luck.

-----
(2014-03-20, 15:02)jurialmunkey Wrote: Hasn't worked since Frodo afaik and ListItem.Art(season.poster) only works in DialogVideoInfo
Thats the Problem, did try Listitem.Art(season.poster) a while ago, but as you mentioned, it works only in DialogVideoInfo.
Reply
#6
@Rantanplan-1
the .. (two dots) should take you down a level.

Sorry, my mistake, you need to use ListItem.Path not ListItem.FolderPath - FolderPath is the library path, not the file path.

Code:
$INFO[ListItem.Path,,../season03-poster.jpg]
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#7
(2014-03-20, 15:29)jurialmunkey Wrote: @Rantanplan-1
the .. (two dots) should take you down a level.

Sorry, my mistake, you need to use ListItem.Path not ListItem.FolderPath - FolderPath is the library path, not the file path.

Code:
$INFO[ListItem.Path,,../season03-poster.jpg]

Thanks!
Now it works!
Reply
#8
How would one identify if the local season poster is available, which condition should one use?
In order to for example choose then the ListItem.Art(tvshow.poster) as an alternative
Reply
#9
@DjCisco

The only way I know of is to use a fallback for the season poster then another control that checks the id to see if it is using the fallback:
Code:
<control type="image" id="9200">
    <texture fallback="blank.png">$INFO[ListItem.Path,,../season03-poster.jpg]</texture>
</control>
<control type="image">
    <texture>$INFO[ListItem.Art(tvshow.poster)]</texture>
    <visible>stringcompare(Control.GetLabel(9200),blank.png)</visible>
</control>

This is off the top of my head, but it should work (I did something in Arctic using this hack). Its a bit annoying because you have to use multiple controls plus it won't work inside a list container.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
(2014-03-20, 23:42)DjCisco Wrote: identify if the local season poster is available, which condition should one use?
In order to for example choose then the ListItem.Art(tvshow.poster) as an alternative

beside jurialmunkey's example you could also work with variables

this should do the job, i guess.
PHP Code:
<variable name="Example">
     <
value condition="StringCompare(ListItem.Season,1) + !IsEmpty($INFO[ListItem.Path,,../season01-poster.jpg])">$INFO[ListItem.Path,,../season01-poster.jpg]</value>
     <
value>$INFO[ListItem.Art(tvshow.poster)]</value>
<
variable
Reply
#11
PHP Code:
<texture background="true">$INFO[ListItem.Path]$INFO[ListItem.Season,../season,-poster.jpg]</texture

Should work without string compares.
Reply
#12
(2014-03-21, 15:07)Rantanplan-1 Wrote:
(2014-03-20, 23:42)DjCisco Wrote: identify if the local season poster is available, which condition should one use?
In order to for example choose then the ListItem.Art(tvshow.poster) as an alternative

beside jurialmunkey's example you could also work with variables

this should do the job, i guess.
PHP Code:
<variable name="Example">
     <
value condition="StringCompare(ListItem.Season,1) + !IsEmpty($INFO[ListItem.Path,,../season01-poster.jpg])">$INFO[ListItem.Path,,../season01-poster.jpg]</value>
     <
value>$INFO[ListItem.Art(tvshow.poster)]</value>
<
variable

That doesn't work because IsEmpty only checks whether strings passed to it are empty, *not* whether the path is valid and the file exists.

For instance, say ListItem.Path returned /tvshows/breakingbad/season1/
The string that then gets passed to IsEmpty would be /tvshows/breakingbad/season01-poster.jpg regardless of whether that file exists, so it will always return false.

A condition to check file existence is a bad idea because variable conditions are constantly being checked, so that means the file system would be constantly read causing massive system performance overheads and unnecessary wear on the disk. That's why we need the fallback texture hack.



(2014-03-21, 15:36)butchabay Wrote:
PHP Code:
<texture background="true">$INFO[ListItem.Path]$INFO[ListItem.Season,../season,-poster.jpg]</texture

Should work without string compares.

It depends on the naming convention -- if it is season01-poster.jpg then it wont work because you need the leading 0
If that is the case you could of course use the following to cut down code
PHP Code:
<value condition="!IntegerGreaterThan(ListItem.Season,9)">$INFO[ListItem.Path]$INFO[ListItem.Season,../season0,-poster.jpg]</value>
<
value>$INFO[ListItem.Path]$INFO[ListItem.Season,../season,-poster.jpg]</value
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Hack to Show Season Poster on Episode Level0