Kodi Community Forum

Full Version: Filter by country
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I'd like to filter/sort my album artists by country.
Since kodi doesn't read the LOCATION tag from Vorbis Commment I tried to write the information into the MOOD tag.
Unfortunately kodi doesn't seem to read the new tag information. Trying to filter results in an empty list.
In the exported music library file there are some <mood> tags containing information from scrapers. (I had activated this option once in the Universal Artist Scraper)
But none of the artists had some newly added country information in the <mood> tag
So how do I get rid of the scraped information in the MOOD tag and replace it with my own data?
If needed I'll provide a log file or one of my .flac files. Just let me know...
In effect there is song mood, album mood and artist mood, and they can all be different. Mood tag in Vorbis comments will be read as the mood of the song and not the album or artist. Album and artist mood comes from scraping (nfo files or remote sources like Allmusic).

Hence nfo files (using a tool or manually), or export artists as xml, edit and import the lot in one go.  Getting fancy if you have the skills you could write a Python script to do it, or down and dirty mess with the db using SQL and update artist mood from song mood (read from tags). Lots of ways to achieve what you want, just none of them designed into Kodi.

If you want to do the SQL approach let me know and I will give some hints. With earlier versions of Kodi I did a similar thing using artist instruments to hold "composer", "orchestra" "conductor" and filter my classical music artists. It isn't too difficult, as long as the idea of editing data doesn't scare you too much.
Ok, wasn't aware of the different types of mood tags. Thank you @DaveBlake for the information.

Since I'm not brave enough to edit the database directly and my skills are far away from writing a python script, I'll give the .nfo file a go.
After a quick view at the wiki page it seems possible to create the Artist Information Folder and the .nfo files with an export from the db.
Is there maybe a tool or something to create an artist.nfo file from the data already present in the vorbis comment tag?
(2020-07-09, 16:01).Erich Wrote: [ -> ]Is there maybe a tool or something to create an artist.nfo file from the data already present in the vorbis comment tag?
There isn't anything I know about that can read embedded metadata from FLAC files and  collate it into artist.nfo, and Kodi is not going to be able to help you either. Yes it can export artist and album data into NFO, but the mood tags in the music files get held as song data.

Data is my thing, so if you have all your music scanned into the library and let me have the MyMusic72.db, then I _may_ be able to do the dirty db work for you. My approach would be to use SQL to move mood from song to artist tables, then export making artist.nfo files that you can then scrape.

Why do that? Well basically I'm a nice guy, and another user is giving me crap on another thread so rather than be angry back to him, I'm offering to do something helpful for you. And if everyone took that stragety wouldn't the world be a better place. Smile
Ouh that sounds fantastic. What a nice guy you are @DaveBlake. Lets make the world a better place... Wink

Here is a link to my music -hidden-

There is one thing that really concerns me.
In the kodi wiki about music nfo files there is written that you have to enable the option Prefer Online Information in order to get data from .nfo files in your library.
Last thing I want is that my music db gets overwritten with data from online scrappers. My music files are generally well tagged and therefore is no need to overwrite this data.

Thank you for all your support!
OK, I will PM you a link to an updated MyMusic72 with the song mood written to the artist mood, and a structure of artist.nfo files. You can just replace your db file with this (it won't have any playback history or new music since you gave me it) probably easiest, or you can use the artist.nfo files.

In future for new artists added to your library, to set country in artist mood you will need to create an artist.nfo file for the new artist with <mood>United States</mood>. If you want other scraped data for that artist then you will either need to add it to the nfo manually, use a media manager, or let Kodi scrape, export artists, edit the artist.nfo it makes and then refresh from artist info dialog to read that nfo.
 
(2020-07-12, 16:37).Erich Wrote: [ -> ]There is one thing that really concerns me.
In the kodi wiki about music nfo files there is written that you have to enable the option Prefer Online Information in order to get data from .nfo files in your library.
Last thing I want is that my music db gets overwritten with data from online scrappers. My music files are generally well tagged and therefore is no need to overwrite this data.
You have misunderstood the wiki. When batch scraping multiple items (on library update if "fetch additional info on update" is enabled, or if you do "query for all" from the context menu) if Kodi finds an nfo file it uses that rather than fetch remote data, there is no setting that changes that. Once scraped the batch scraping will not rescrape artists or albums that have been succesfully scraped.

When refreshing artist/album at a time from the info dialog, you do get prompted to say an NFO files was found and can choose to fetch remotely rather than use the nfo.

"Prefer Online Information" when enabled controls how scraped data is merged with values derived from tag data. Only some of the additional artist or album information fetched by scraping gets initial values from music file tags. For artists that is just sort name, for albums it is more (title, genre, year, compilation, label and artists). I would never enable it.

As it is "Prefer Online Information" enabled has very limited usefulness. The original intention was to have some auto sync facility with Musicbrainz - fetching updates silently - but that was never fully implemented. Such a feature needs perfect Muiscbrainz tagging to being with and too many uses don't do that. It was then modified/mis-interpreted by others, and then I did the same to neutralise the unwanted side-effects it was having. IMO album title, year, compilation, artists should only come from music file tags, and not be editable (and hence differ from the song values). That leaves album genre and artist sortname....

Anyway probably far more information than you require.
Bottom line: leave "Prefer Online Information" disabled and no scraped album or artist data will overwrite any values derrived from tags.
Just replaced the MyMusic72.db and everything works like a charm. Thank you very much for all your support!

Ok, thanks for the clarification about the Prefer Online Information setting.
Like you said before, I just leave it disabled.
Good @.Erich , glad you have things as you wanted. Smile
I also hope that you got how to deal with new artists and add country as mood via NFO. Happy music library browsing