Static Text Labels
#1
I am trying to put the movie year on the same line as the movie title. You can see how it looks in the pictures. I have wrapped the year in parentheses but I want to hide the parentheses if the year is empty as they are on the movie sets. I have tried IfEmpty and several substring lines with no success. Is this possible and if so can someone point me in the right direction? The current code is below.

Code:
<label>[b]$INFO[ListItem.Label][/b] ($INFO[ListItem.year]) </label>
<visible>Container.Content(movies)</visible>

Image

Image
Reply
#2
<label>$INFO[ListItem.Label] $INFO[ListItem.year,(,)] </label>

should work fine, it works like this
$INFO[infolabel,prefix,postfix] and id the infolabel is empty the prefix,postfix wont show
Reply
#3
Jezz_X Wrote:<label>$INFO[ListItem.Label] $INFO[ListItem.year,(,)] </label>

should work fine, it works like this
$INFO[infolabel,prefix,postfix] and id the infolabel is empty the prefix,postfix wont show

Thanks so much. It worked great. I owe you a frosty beverage of your choice.
Reply
#4
Jezz_X Wrote:<label>$INFO[ListItem.Label] $INFO[ListItem.year,(,)] </label>

should work fine, it works like this
$INFO[infolabel,prefix,postfix] and id the infolabel is empty the prefix,postfix wont show

I have another issue something along those lines. I want to include the movie duration with Listitem.duration. If I include the $LOCALIZE[12391] for the minutes then I get two instances of the minutes showing up. This only happens if I use a third party scraper such as Ember Media Manager. The code I am using is

Code:
<label>$INFO[ListItem.duration,, $LOCALIZE[12391]]</label>

I want to be able to hide the $LOCALIZE[12391] if the movie is using the nfo instead of the XBMC scraper. Is this possible?
Reply
#5
Redd Wrote:I have another issue something along those lines. I want to include the movie duration with Listitem.duration. If I include the $LOCALIZE[12391] for the minutes then I get two instances of the minutes showing up. This only happens if I use a third party scraper such as Ember Media Manager. The code I am using is

Code:
<label>$INFO[ListItem.duration,, $LOCALIZE[12391]]</label>

I want to be able to hide the $LOCALIZE[12391] if the movie is using the nfo instead of the XBMC scraper. Is this possible?

this should be handled by xbmc imo...and i thought it used to, but i'm seeing the same issue lately.

in my .nfo files, the runtime field created by ember looks like:
<runtime>100 mins</runtime>

now either xbmc should strip the 'mins' part when adding the info to the db,
or maybe ember should create a proper runtime field, like:
<runtime>100</runtime>

using xbmc r34164 with Confluence:

Image
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
I found a uniuqe solution while looking through the code of several skins. I came across this in the Big Alaska skin. It seems to work well for me.

Code:
        <control type="label">
                <posx>0</posx>
                <posy>692</posy>
                <width>1280</width>
                <height>50</height>
                <align>center</align>
                <font>Font_Bartowski_Movies_Plot</font>
                <textcolor>ffffffff</textcolor>
                <label>$INFO[ListItem.duration]</label>
                <visible>substring(listitem.Duration,min)</visible>
                <visible>Container.Content(movies) + !IsEmpty(ListItem.duration)</visible>
            </control>
            <control type="label">
                <posx>0</posx>
                <posy>692</posy>
                <width>1280</width>
                <height>50</height>
                <align>center</align>
                <font>Font_Bartowski_Movies_Plot</font>
                <textcolor>ffffffff</textcolor>
                <label>$INFO[ListItem.duration,, mins]</label>
                <visible>!substring(listitem.Duration,min)</visible>
                <visible>Container.Content(movies) + !IsEmpty(ListItem.duration)</visible>
            </control>

So thanks to Amra and if it was original code from Alaska then thanks Hitcher.
Reply
#7
that may indeed be the best workaround...

on a side note, does anyone know how (in what order) xbmc determines the length of a video?
from my own experience, it looks to be like this:
- use <durationinseconds> field from local .nfo file
- use <runtime> field from local .nfo file
- determine the runtime from the videofile itself when it's added to the library (doesn't work for dvd's / .vob files)
- use scraper to fetch the info online
- determine the runtime from the videofile itself when it's played for the first time (this will overwrite any previous found value).
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
We use:

1. <durationinseconds> if found.
2. videofile runtime itself (run in background thread, so may not be there for quite a while, and is not available for dvd/iso at all until playback has been done).

If neither are available we fallback to <runtime>.

Cheers,
Jonathan
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.


Image
Reply
#9
This is what I use for the mins in the nfo problem:

Code:
<control type="label">
    <description>Runtime label</description>
    <posx>80</posx>
    <posy>110</posy>
    <width>320</width>
    <height>30</height>
    <label>$INFO[ListItem.Duration] mins</label>
    <align>left</align>
    <aligny>center</aligny>
    <font>cirrus_35</font>
    <textcolor>white</textcolor>
    <shadowcolor>black</shadowcolor>
    <visible>!SubString(ListItem.Duration,mins)</visible>
</control>
<control type="label">
    <description>Runtime label</description>
    <posx>80</posx>
    <posy>110</posy>
    <width>320</width>
    <height>30</height>
    <label>$INFO[ListItem.Duration]</label>
    <align>left</align>
    <aligny>center</aligny>
    <font>cirrus_35</font>
    <textcolor>white</textcolor>
    <shadowcolor>black</shadowcolor>
    <visible>SubString(ListItem.Duration,mins)</visible>
</control>

Works well for me!

<EDIT> My apologies, this exact solution is outlined two posts up, whoops.
Reply

Logout Mark Read Team Forum Stats Members Help
Static Text Labels0