Kodi Community Forum
Info label for Album Duration? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Info label for Album Duration? (/showthread.php?tid=352245)



Info label for Album Duration? - YerMusic (IO) - 2020-03-03

Is there one?  Looked over the wiki and couldn't come up with anything.


RE: Info label for Album Duration? - scott967 - 2020-03-05

(2020-03-03, 22:37)YerMusic (IO) Wrote: Is there one?  Looked over the wiki and couldn't come up with anything.
No.  And I don't think "album duration" is a well-defined concept.  I don't know of any tag format that supports it, and I don't think album scrapers can get it at the current scrape sites.  So it isn't stored in the library.  It could be computed from the sum of the track durations at least for tracks in the library but I don't know of a way to do that in skin code.

scott s.
.


RE: Info label for Album Duration? - jurialmunkey - 2020-03-05

Yeah I don't think it's possible without a script of some kind.

In terms of a script - Skin Helper provides a window property of current focus album duration:
https://github.com/kodi-community-addons/script.skin.helper.service/wiki/Listitem-Properties---Music-items

$INFO[Window(Home).Property(SkinHelper.ListItem.Duration)]


RE: Info label for Album Duration? - jjd-uk - 2020-03-05

There is $INFO[Container.TotalTime] which with a quick test in Estuary seems to give desired result.

Changing the TopBar entry in MyMusicNav.xml to

xml:

<include content="TopBar">
<param name="breadcrumbs_label" value="$LOCALIZE[2]" />
<param name="sublabel">$INFO[Container.SortMethod,$LOCALIZE[31022]: , ∙ ]$INFO[Container.CurrentItem,, / ]$INFO[Container.NumItems]$INFO[Container.TotalTime,[CR]Duration Test: ,]</param>
</include>

gives

Image


RE: Info label for Album Duration? - Chillbo - 2020-04-12

@jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh


RE: Info label for Album Duration? - jjd-uk - 2020-04-12

$INFO[Container.TotalTime] only works when you're within container you want the info for, what you want is to have the total duration for the album at the level above where you can display the Album music info dialog, however I'm not aware of anyway to do that.


RE: Info label for Album Duration? - mardukL - 2020-04-12

(2020-04-12, 12:49)Chillbo Wrote: @jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh

a way is to save that label as a custom windowproperty (e.g. hidden button in the focusedlayout ) to store it and call it in the wished dialog.

e.g.
xml:
<control type="button">
<visible allowhiddenfocus="true">false</visible>
<onfocus condition="String.IsEqual(ListItem.DBtype,album) + !string.IsEmpty(Container.TotalTime)">SetProperty(albumduration,$INFO[Container.TotalTime],home)</onfocus>
</control>

label usage for the dialog
$INFO[Window(home).Property(albumduration)]


RE: Info label for Album Duration? - Chillbo - 2020-04-14

(2020-04-12, 15:24)mardukL Wrote:
(2020-04-12, 12:49)Chillbo Wrote: @jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh

a way is to save that label as a custom windowproperty (e.g. hidden button in the focusedlayout ) to store it and call it in the wished dialog.

e.g.
xml:
<control type="button">
<visible allowhiddenfocus="true">false</visible>
<onfocus condition="String.IsEqual(ListItem.DBtype,album) + !string.IsEmpty(Container.TotalTime)">SetProperty(albumduration,$INFO[Container.TotalTime],home)</onfocus>
</control>

label usage for the dialog
$INFO[Window(home).Property(albumduration)] 

The way I see it, saving this would only be possible, if you're in the single album view where the 'Container.TotalTime' infolabel is populated. What I'd like to do so is exactly what @jjd-uk understood: I'd like to get the album duration information while I'm one level up - in the albums overview - for each of the albums currently in focus. Or in the music info dialog for an album - which is only accessible from the albums overview and thus sharing the same issue. Or am I getting your approach wrong, @jurialmunkey?