Kodi Community Forum

Full Version: Questions about track naming template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Been fiddling around with the Audio Tag File Naming Template and have a few questions:

What role does putting the brackets around %N. play? Doesn't seem to make any difference?

Except, when I try to bold the artist like this:

[%N.] [%A]

It doesn't display the artist in bold correctly, until I take away the %N brackets like this:

%N. [%A]

Also, in Estuary, it displays the Year first in a different colour. Like this

2017 1. Artist - Title

Where does the Year get specified, and how do I change the colour?

Thanks!
The label formatter/mask/naming template feature goes back to XBMC days, seems pretty limited to me and is unlikely to be enhanced as there are other ways for skins to implement things. But I can share with you the comment in the code

Code:
/* LabelFormatter
* ==============
*
* The purpose of this class is to parse a mask string of the form
*
*  [%N. ][%T] - [%A][ (%Y)]
*
* and provide methods to format up a CFileItem's label(s).
*
* The %N/%A/%B masks are replaced with the corresponding metadata (if available).
*
* Square brackets are treated as a metadata block.  Anything inside the block other
* than the metadata mask is treated as either a prefix or postfix to the metadata. This
* information is only included in the formatted string when the metadata is non-empty.
*
* Any metadata tags not enclosed with square brackets are treated as if it were immediately
* enclosed - i.e. with no prefix or postfix.
*
* The special characters %, [, and ] can be produced using %%, %[, and %] respectively.
*
* Any static text outside of the metadata blocks is only shown if the blocks on either side
* (or just one side in the case of an end) are both non-empty.
*
* Examples (using the above expression):
*
*   Track  Title  Artist  Year     Resulting Label
*   -----  -----  ------  ----     ---------------
*     10    "40"    U2    1983     10. "40" - U2 (1983)
*           "40"    U2    1983     "40" - U2 (1983)
*     10            U2    1983     10. U2 (1983)
*     10    "40"          1983     "40" (1983)
*     10    "40"    U2             10. "40" - U2
*     10    "40"                   10. "40"
*
%Y is year.
I was not aware that it supported bold, and pretty sure it does not handle colour. Estuary isn't using the naming template at all.
Should've mentioned I'm viewing this in file mode (not library).

Yes, it does support Bold and Italic:

http://kodi.wiki/view/Audio_file_tags

And Estuary does appear to be respecting what you enter in the template, the same as every other build, at least, as I described before.

Except, in Estuary only, the year is appended at the front, highlighted in light blue (default), and there doesn't seem to be anywhere that's an option.

Any idea where that's coming from?
Ah file mode, that does make a difference. Can I not entice you into the music library? Smile

So bold and italic.... but just because it says so in the wiki does not mean it is true (any more). :p

Quote:Any idea where that's coming from?
Poking about in code I can see CGUITextLayout:TonguearseText processing [B] etc., and there are mark-ups like [COLOR ffab007f] too, but honestly I don't know. Maybe someone else does?
The colour? well it's the skin that defines that.
Thanks @jjd_uk, so the year in front and in colour is decided by the skin (much as I thought) not the naming template. The template just effects what is in lable1, for those skins that use lable1 and label2.

There is a mixing of very very old way of specifying what is on screen (naming template, and something users could control), to the newer way (the skin defines it all).
(2017-06-02, 15:13)jjd-uk Wrote: [ -> ]For Estuary I assume it's this https://github.com/xbmc/xbmc/blob/e644c5...t.xml#L255

Ta!