Solved Track naming template
#1
Dear all,
I have been trying to create a track naming template (audio files) for quite a while now.
The desired product should be:
artist (any colour) - album (regular) - track title (Italic) - track number (another colour).
I found and followed the instructions in Kodi's wiki, and I have no difficulties whatsoever formating any two of these three elements according to my needs.
But when I try formating the third element (whatever is still left and wherever ...), the whole system of square brackets and % fails, i.e. it doesn't any longer follow the own, previous rules ...
Clearly, I suspect that this is a bug, but I can't rule out that the error resides on my part ...
Could anyone please send me helpful instructions as to how to format the third and final element of my template?
Your help would be greatly appreciated, regards, PeterD.
Reply
#2
(2021-04-21, 17:15)PeterD. Wrote: artist (any colour) - album (regular) - track title (Italic) - track number (another colour).
Can you post the code or a screenshot of the code you have entered.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
Is this the sort of thing you are after?

Image

So, that's Artist in red, Album in bold, track title in italics and track number in yellow. The line to do this is as follows (substitute B for D and I for K as the board formatting messes up the original line!)

xml:
[[COLOR red]%A[/COLOR][D]] - %B[[/D][K] - %T - [/K][COLOR yellow]][%N[/COLOR]]
Probably Kodi's GUI will not display the entire line so it might be easier to edit the guisettings.xml file which can be found in your userdata (wiki) directory. You must edit this file while Kodi is not running otherwise your changes will be overwritten. The line you need to find in there is <setting id="musicfiles.trackformat">[[COLOR red]%A[/COLOR][D]] - %B[[/D][K] - %T - [/K][COLOR yellow]][%N[/COLOR]]</setting>. Obviously, yours will have a different template in it. Change the line and save it. Then start Kodi.

Hope this helps.
Learning Linux the hard way !!
Reply
#4
Thanks so much, black_eagle, for your prompt and very helpful response.
In the meantime I have managed to replicate what you have kindly instructed me.
As depicted in my screenshot, https://postimg.cc/SXCWjqRjthe desired code now works perfectly for those tracks that are part of a complete album (and hence do have a track number, in yellow) stored locally. However, for those tracks that aren't part of a whole album (and hence do not have a track number at all) there is obviously still room to improve ...
How can one serve both sets of tracks with a single code line?
Please help me out here again, as to solve this is obviously way out of my league ...
Really appreciate your help, best regards
Reply
#5
(2021-04-22, 01:06)PeterD. Wrote: As depicted in my screenshot, https://postimg.cc/SXCWjqRjthe desired code
The image link does not work.

Button 14 or 19 to upload images
Image
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
(2021-04-22, 01:06)PeterD. Wrote: As depicted in my screenshot, https://postimg.cc/SXCWjqRjthe desired code now works perfectly for those tracks that are part of a complete album (and hence do have a track number, in yellow) stored locally.

Good, glad you got it working Smile  Link doesn't work unfortunately though.
(2021-04-22, 01:06)PeterD. Wrote: How can one serve both sets of tracks with a single code line?

Hmmm, just off the top of my head, I don't think that that is possible.  I think that this is an either/or situation where you can have one or the other but not both.  However, I'll have a look later when I have time and see if I can prove myself wrong.

Hehe, turns out it is possible I just needed to think a little laterally!  Using the same subtitutions as before (D & K), this line should get you what you want.

xml:
[[COLOR yellow][COLOR red]%A[/COLOR][COLOR white][D]] - %B[[/D][K] - %T[/K][/COLOR]][ - %N]

In the meantime, this is how I worked out the line above.

Change the colour to yellow first and then to red in the first grouping.  This means that turning off a colour will return to yellow. Turn red off again after displaying the artist, set colour to white and turn on bold. No grouping for the album (as we might not have an album title and if not it will mess up our formatting).  2nd group turns off bold, turns on italic then displays %T (track), turns off italic and changes the colour to yellow by turning off white. 3rd group displays track number if there is one.

No album title, no track number.

Image

Album title, mix of tracks with and without track numbers (deliberately badly tagged album for testing, honest!)

Image

Might not be too obvious from the screenshots but the '-' before the track number is yellow. You can move it in the line to after the %T so it is white but it will show even if there is no track number. As I've written it, it only shows if there is a track number. This is as close to what you want as I think it's possible to get and better than I expected to be able to manage.
Learning Linux the hard way !!
Reply
#7
Hi black_eagle,
Thanks again for your great help. I really had no idea how fantastic the final version of this template would be ... Please do not waste any time to claim the copyright !
Thanks also for the hint re button 19, I hope everything is attached now. To follow up on my steep learning curve over the past 24 hours or so, I will also over-saturate everyone with yesterday's corrected link, and finally with today's. Here they are:
1) https://postimg.cc/3WkCzz42

2) https://postimg.cc/jnRwX813

Also, black_eagle, I really have no idea why, but when communicating with you the following quote comes to my mind (I am sure you have heard it already ...):
There are only 10 types of people in this world,
those who understand binary and those who don't.

I promise that I will stick to my simplistic biochemistry-based way of thinking in the future ...

Short summary:
yesterday's ambitious version (with an own library entry error in the first line, yellow 9):
Image
today's much improved version (also containing the correction of my internal error in the first line), ta ta ...Image
Reply
#8
@PeterD. I have to say that in all my years of using XBMC/Kodi it had never occurred to me to try and colourize the track listing using the track naming template.  Your question therefore sparked my curiosity and I simply had to find out just what is and isn't possible.  I learnt something along the way and hopefully helped you out by doing so, so thank you to you too.  Needless to say, my own track listings are no longer just white text!!
Learning Linux the hard way !!
Reply
#9
Hi black_eagle,
thanks for your short resume and for kindly offering a one-all draw. I very gladly accept ...
So far I've found (testing by typing) the following colours: red, green, blue, yellow, orange and grey. Are you aware of a list that summarises all colours available in these Kodi codes? Best regards and thank you again for your help, PeterD.
Reply
#10
(2021-04-23, 15:02)PeterD. Wrote: Are you aware of a list that summarises all colours available in these Kodi codes?

Absolutely Smile
The file is called colors.xml and is located in various places depending upon your operating system!  Internally it is special://xbmc/system/colors.xml. This should translate for Android into /data/data/org.xbmc.kodi/cache/apk/assets/system/colors.xml.  See special protocol (wiki) for more details if you need them. The master copy of it can be viewed here if that's easier for you.  You can also specify the colour value in hex AARRGGBB where AA is the alpha(transparency) channel.  So you can use stuff like [COLOR FF345678] which gives you total control over the colours.
Learning Linux the hard way !!
Reply
#11
Hi again, thanks for the prompt response. Just tested that ... marvellous.
So actually, there are a bit more than the six colours I mentioned ...
Once again you have proven me wrong in assuming that I am reasonably close to the truth, see my assumption at the start of this thread. I guess that's a good close to this.
Thank you very much for your perfect help, I think that in this thread you have supplied not only me, but a lot of other "newbies" a whole bunch of fascinating insights !!
Best wishes and have a nice weekend.
Reply
#12
Cheers, you too.  I'm glad I could be of assistance Smile

Thread marked solved.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Track naming template0