Posts: 6
Joined: Sep 2016
Reputation:
0
I have a library of flac files that I am trying to import and use in Kodi and have hit a bit of a snag. If somebody would be kind enough to point me in the right direction I would be grateful.
My library is about 750 albums so manual editing is not possible. All of the files have Genres, nearly all have Styles, and about half have Moods, these are all in flac tags with individual entries for multiple Genres etc. Most of this was read from AllMusic years ago when they were less restrictive and I am happy about the values. When I read this into Kodi, with the online information switched off, the Genres get read but no Styles or Moods. I looked in the database and the strStyles and the strMoods fields are null.
I have searched the Wiki and Forum and have come up with the information that these fields are only read from online sources or .nfo files and not direct from the files. Is this correct ? If so does anybody know an automatic way of extracting the information from the flac files into .nfo files ?
Thanks.
Posts: 6
Joined: Sep 2016
Reputation:
0
Thanks for the reply. I'm using v16.1 under Windows for now with a NAS box for media and database and intending to roll out to Android boxes on TV's about the house. From your reply and further examination of the database structure it appears that the way Kodi handles Genres, Styles and Moods does not fit with my usage and thoughts on the matter which basically originate from AllMusic and are somewhat echoed by Discogs and AudioDB.
I use Genre as a broad category (Rock, Pop, Folk etc), I use Style as a sub-genre (so, Heavy Metal, Punk etc under Rock), Mood would be Happy, Sad, etc as applies, independant of Genre or Style. These should all be per Song rather than per Album as an album could contain many different Genres, Styles and Moods (in particular Compilations). The Album tags would be multiple entries where required, so an album would have genre entries for Pop and Rock if songs on the album had either. Similarly the Artist entry would be accumulations of the Album entries for that Artist.
This all becomes very useful thanks to the advent of Smart Playlists so that one can devise a playlist using all three fields to suit the mood of the moment. This is my intention.
From your mention of ID3 tags I assume that historically Kodi worked with MP3 files and has been expanded to other formats over the years. I don't know anything much about MP3 other than what it sounds like, I've use FLAC files since I started ripping LP's and CD's (at least 12 years) but it seems to me that a larger set of tags should be allowed than are available in ID3 where they are useful. I realise that is easy for me to say who isn't doing the work but it wouldn't be too much of a stretch to add and would not affect the MP3 usage at all.
What I can and will do is look for a 3rd party tag extractor to .nfo and report back here as to how it all works for future reference of interested parties.
Posts: 6
Joined: Sep 2016
Reputation:
0
Dave, I am in the middle of exporting tags to .nfo files using MP3Tag which I have sort of got working but then I noticed something strange with compilation albums, which ties in to another thread you started so I thought I'd bring it up.
Whether the <compilation> element for the album is true or false or 1 or 0 or anything else I can think of it gets set to false in the database when importing a .nfo. Is this deliberate and something to do with the tests mentioned on the other thread ? Surely the information in the .nfo should be taken at value and not subject to tests ? I am testing with an Eagles Greatest Hits album so there is only one artist.
I looked at the SQL in the log and it's false at that point so it's something to do with the reading of the .nfo file. If I set the flag directly in the database and export the .nfo it shows compilation as true so it works ok in that direction.
Also it appears that the only nfo files exported are for where the album info has been refreshed and not where it has been read directly from the tags. This was actually useful as I'm testing and only wanted a couple of albums worth but seems a wierd way to do it, can this be switched by an option of some sort ?
Posts: 6
Joined: Sep 2016
Reputation:
0
Ok I've done a few more tests and this doesn't work at all the way I thought it did.
If I remove the album.nfo, set the prefer online info option then refresh the album info I get the info from MusicBrainz apart from the bCompilation field is still not setting correctly despite MusicBrainz returning the release-group type as "Compilation".
However..
If I reinstate the album.nfo, leave prefer online info on then refresh the album info I get the correct true setting for bCompilation. But the wierd bit is other values are also taken from the nfo rather than online. When album.nfo wasn't there the Label was set as "Asylum Records" (from MusicBrainz) but when it was there the field was empty as in the nfo. So by setting "Prefer online information" I actually get the nfo information preferred !
I need to test this a lot more but it appears to do what I need to get the tag info into the database via an nfo file but right now my head hurts so I'm going to watch the telly.
On a related note and referencing the other compilation thread is there any reason I can't use the type field to indicate a compilation, or indeed an anthology, and hence use that in a Smart Playlist.
Posts: 6
Joined: Sep 2016
Reputation:
0
I've cobbled together an MP3Tag script that creates the NFO files so that end of it works ok. This means the nfo is (fairly) quick to make and any management is done in the flac tags or in the script. This also means I can put whatever I like in the fields of the NFO file based on string comparisons of any of the flac tags (or whatever). I am keen to keep all the information relating to the music inside the flac files and have anything required by the program generated from that information rather than scraped online into the programs database. This keeps me independant of any particular program, not reliant on online database accuracy, which is variable, and mostly just seems the right way to do it.
I've just tested it using "Anthology" in the nfo type field and a Smart Playlist with "Type contains anthology" as the rule and it works fine. My initial thought is to still set the compilation field if the flac file is set thus, and to use the type field to signal "Various Artists", "Anthology" and whatever else occurs to me later as a means to select with in a Smart Playlist.
I'll post the MP3Tag script when I get it fit to be seen in public.
Posts: 4,545
Joined: Jun 2015
Reputation:
269
2016-09-12, 13:43
(This post was last modified: 2016-10-04, 19:36 by DaveBlake.)
Thanks for sharing Steve.
I would add a couple of notes for future reference for others.
1) This is using the mbid tag names in FLAC files. It is crazy but they are slightly different in each tag format
e.g. "TXXX MUSICBRAINZ ARTIST ID" in id3, "MUSICBRAINZ_ARTISTID" in FLAC and APE, "MusicBrainz/Artist Id" in ASF
2) Steve has added a custom tag called RELEASETYPE to his music files. Kodi (< v17) does not process this tag when it scans songs into the library. However in the library the album table does have a strReleaseType field that gets populated by either "album" or "single" depending on if the songs without an album title have been scanned. Do not confuse these different items!
The Mp3tag script takes this custom tag and translates it into a <type> element in an NFO file. When the NFO is scraped the type value is written to the album table strType field. This is the field that is queried by the type rule in album smart playlists. It has no specific use elsewhere in Kodi, so really can be used in whatever way the user wants to categorize albums.
Posts: 4,545
Joined: Jun 2015
Reputation:
269
2016-10-04, 19:34
(This post was last modified: 2016-10-04, 19:38 by DaveBlake.)
It is worth noting that v17 now scans what in Picard this is called "release type" tag that appears in the various formats respectively as TXXX:MusicBrainz Album Type (Id3 v2.4), RELEASETYPE (Vorbis/Xiphe/FLAC), MUSICBRAINZ_ALBUMTYPE (APE), MusicBrainz/Album (ASF) Type, ----:com.apple.iTunes:MusicBrainz Album Type (mp4/iTunes)
The data is stored as the album type, although the contents can be later overwritten by values in NFO files etc.