Kodi Community Forum
Req Add support for custom music tags - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Music Support (https://forum.kodi.tv/forumdisplay.php?fid=263)
--- Thread: Req Add support for custom music tags (/showthread.php?tid=295690)



Add support for custom music tags - cvwillegen - 2016-11-04

Sometimes a 'genre' is not enough to 'select' a disc. For instance: For our daughter, we have classical music suitable for kids (think: https://www.youtube.com/watch?v=MfM7Y9Pcdzw). So, the genre of these discs would probably be 'classical'.

But, we also have other types of discs for her. Perhaps a spoken book. Genre: Audiobook. Or, music from K3. Genre: Pop.

I have thought about this issue a few times over the past few days, and I think that the following tag scheme would enable me to do anything I want:

METADATA block #2
type: 4 (VORBIS_COMMENT)
is last: false
length: 192
vendor string: reference libFLAC 1.2.1 20070917
comments: 6
comment[0]: ARTIST=4m.Ellende
comment[1]: ALBUM=Verloren liefde (Maxima)
comment[2]: TRACKNUMBER=01
comment[3]: TITLE=Verloren liefde (Maxima)
comment[4]: TAG=AUDIENCE:children
comment[5]: TAG=PARODYConfusedtyle
comment[6]: TAG=AUDIENCE:young adult

In Kodi (and Yatse...) you should be able to select a tag browser that shows you the tag keys (to the left of the : in the TAG comment), and if you select the tag key you get to choose from the tag values, or combinations thereof. Note that I just thought of a few possible tag keys and values, nothing definitive here.

I'd like to try to dive into the Kodi source to see if I am able to do the tag processing and storing them in the database, if this idea seems like a good one :-)


RE: Add support for music tags - DaveBlake - 2016-11-04

You are requesting Kodi support custom tagging, as an addition to the standard music file tags. This is something another user has requested some time ago, and something I thought about when I first looked at Kodi and wanted to contribute. But on looking at the way Kodi is implemented it became obvious that adding processing for the standard tags Kodi didn't handle was the best place to start, before considering adding generic custom tags. That is an activity I am still in the middle of.

You see adding tag processing and modifying the database to store the values is the easy part, quite a lot more work is envolved to make these values useable via the UI and/or JSON API (so that the remote apps like Kore or Yatse and web interface this Chorus can use them too).

As for diving in.... well on the one hand development work on Kodi is welcome and new skilled contributors much needed. But on the other it is a difficult merry-go-round to catch a ride on. The current dev team does not have sufficient spare time to mentor work from new contributors, nor great interest in the music area. This can make trying to contribute very frustrating for all concerned. I am the team member with currently most interest in tag proceesing and the music database, and despite having successfuly contributed both fixes and improvements to Kodi my work is still greatly delayed waiting for approveal from other team members.

I don't intend to put you off, but I do want to be honest about the pitfalls you may encounter when contributing to Kodi rather than them come as a nasty surprize. I would also welcome collaboration - easier if people modifying same areas of Kodi work closely and discuss what they are doing than pull in different directions. But given the lack of documentation the starting point is always the existing code, digging through and understanding how it works. So set up an dev environment, branch the repo and have a play. Smile

Meanwhile let's discuss the problem you set out to solve with processing for custom tags. I have described elsewhere how I use genre creatively as a way to categorise my music, I do not stick to the standard genres e.g. "Rock", "Classical" etc., (not that there actually are any standard genres). Instead I use multiple genre values per song as custom tag values, so I would tag your example with genres of "Classical", "Children" etc. adding a genre of "children" to the songs, audiobooks or whatever.

Your folder structure could also be used to separate childrens music etc. and then use smart playlists based on path rules.

But I have to also note that albums can have style and theme values added via NFO files, and you can create smart playlists using them. So you could categorise your music that way as well.

I will close by saying since Kodi does support many standard music tags a better title for this thread would be "Add Support for Custom Music Tags"