Kodi Community Forum

Full Version: Trying to add movies duration to widget...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all Smile

I'm trying to add the movie duration after its year of release in the movie widget but with no success so far.

I have done the following...

In the IncludesWidgetContent.xml file (line 204)
PHP Code:
<label>$VAR[$PARAM[widgetLine1]] $VAR[$PARAM[widgetLine2]] $VAR[$PARAM[widgetLine2b]]</label

In the script-skinshortcuts-includes.xml (line 1176)
PHP Code:
        <include name="FixedWrapWidgetLabels">
            <
param name="id">80111</param>
            <
param name="widgetLine1">widgetLine11</param>
            <
param name="widgetLine2">widgetLine21</param>
            <
param name="widgetLine2b">widgetLine21b</param>
        </include> 
... and (line 3600) ...
PHP Code:
    <variable name="widgetLine21b">
        <
value>• $INFO[Container(80111).ListItem.Duration]</value>
    </
variable

Any idea where I'm going wrong?
Kodi 16 I assume?

The following info could be wrong, as I only downloaded the skin files to look at, I don't have a version of Kodi 16 running anywhere to test. But the basic advice SHOULD be sound. Smile

Edit the 'template.xml' file found in the 'shortcuts' folder in the skin, instead of the 'script-skinshortcuts-includes.xml' file. That is not meant to be edited, and is made by Skin Shortcuts based on the content of the 'template.xml' file (where widgets are concerned in Mimic).
If, as I assume, it is Kodi 16 version of Mimic you are editing, there will be four widget templates available to be built within the template.xml file (plus a fanart template at the bottom). These are 'widget-fixed', 'widget-wrapped', 'widget-defaultpanel' and 'widget-verticalpanel'. Edit the ones you wish to see the movie duration info with. e.g. for the 'widget-verticalpanel' widget, you would change line 628 to this:

Code:
<label>$VAR[widgetLine3$SKINSHORTCUTS[id]] $VAR[widgetLine2b$SKINSHORTCUTS[id],, MINS]</label>

Then, at the end of that widget's template, there is the set of variables pertaining to that widget. You would add your new variable in there after line 706. Paste in there something like this:

Code:
<variable name="widgetLine2b$SKINSHORTCUTS[id]">
        <value condition="!IsEmpty(Container(8011$SKINSHORTCUTS[id]).ListItem.Duration)">• $INFO[Container(8011$SKINSHORTCUTS[id]).ListItem.Duration]</value>
</variable>

Do that for each of the widgets you wish to change in the template. If you wish to change the labels for the first two widgets in the templates.xml file, then you will have to additionally edit the 'IncludesWidgetContent.xml file' as you have above, as well as adding the param:

Code:
<param name="widgetLine2b">widgetLine2b$SKINSHORTCUTS[id]</param>
in the relevant area of that widgets template in templates.xml (i.e. for 'widget-fixed' add the param after line 23)
Good luck.

P.S This will add duration information whenever it is available. For episode widgets as well, for example.
Thank you very much, Tikipeter, I'll give it a try. Smile
Kodi 16 indeed, I'm using the Android (TV) version and couldn't play any movie files in 17.
BOOM, it works. Big Grin
Thanks again, Tikipeter, I very much appreciate it. Smile