NFO files/Music

From Official Kodi Wiki
< NFO files(Redirected from NFO files/music)
Jump to: navigation, search
NFO Contents

See also:


Return to:

Home icon grey.png   ▶ NFO files ▶ Music


1 General

Unlike the video library, Kodi cannot create library entries for music from nfo files. Instead, Kodi scans the embedded tags in the song files to create the library entries. The nfo files can then be used to add additional information to what has already been scanned into the library from the embedded music file tags. The music library uses two types of NFO files- one for artists (artist.nfo) and one for albums (album.nfo).

Some additional points:

  • A number of database fields can be populated initially by music file tags, but then be overwritten by online scraping or nfo scanning. Whether this occurs depends on the setting Prefer Online Information in Settings>Media>Music. If disabled, these fields will remain with the data scanned from the music file tags. If enabled these fields will be overwritten by information obtained from either the online scrape or local nfo file scan. The affected fields are shown in the tables below. If you are satisfied with your tagging, leave this item disabled.
  • v18 introduces the Artist information folder which enables the use of local artwork and information (nfo files) for all artists, not just album artists as in previous versions. This is of benefit for collaboration albums, various artist releases and classical recordings to name a few.
  • There is no XML tag for votes of individual Songs. This can only come from the music file tags. Album votes can come from either online or local nfo scraping.


2 nfo Name and Location

Music scanners will fetch additional artist and album information from nfo files when available.

For additional artist information each artist needs a separate artist.nfo file inside the artist subfolder located in the Artist information folder. The correct name of the artist subfolder does matter. See left image below

For additional album information each album needs to be in its own unique folder, and have a separate album.nfo file located there. See right image below



3 Artists

This section deals with the requirement for the artist.nfo file.


3.1 nfo Tags

The following table lists the available tags that can be used in the artist.nfo file.


NFO (xml) Tag Required Overwrites* Multiple ** Notes
<artist></artist> Yes No No The top level parent tag for the nfo file. All other tags must be contained within these two tags
<name></name> No Yes No Overwrites artist name in artist table, when "prefer online info" is "enabled". Does not change that name anywhere else
<musicBrainzArtistID></musicBrainzArtistID> No No No Exported but not imported
<sortname></sortname> No Yes No
<type></type> No No No
<gender></gender> No No No
<disambiguation></disambiguation> No No No
<genre></genre> No No Yes Artist genre is not related to song genre
<style></style> No No Yes
<mood></mood> No No Yes
<yearsactive></yearsactive> No No Yes
<instruments></instruments> No No Yes
<born></born> No No No
<formed></formed> No No No
<biography></biography> No No No
<died></died> No No No
<disbanded></disbanded> No No No
<thumb aspect="" preview="""></thumb> No No Yes Path to available online artist images.
Importing will also accept paths to local art files which can subsequently be exported
<path></path> No No No Exported but not used on Import
<fanart>
  <thumb preview=""></thumb>
</fanart> 
No No Yes Path to available online artist images.
Importing will also accept paths to local art files which can subsequently be exported
<album>
  <title></title>
  <year></year>
</album>
No No Yes Artist discography.
A scraped listing not releated to the albums in the library
Notes
* If the setting Prefer Online Information in Settings>Media>Music. If enabled, these items may be overwritten in the library database.
** With multiple value fields those values are entered using an XML tag per value. When no data exists the XML tag will not be created on export


3.2 Template nfo

A template NFO File is provided below that can be copied into your own file and completed.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<artist>
    <name></name>
    <sortname></sortname>
    <type></type>
    <gender></gender>
    <disambiguation></disambiguation>
    <genre></genre>
    <style></style>
    <mood></mood>
    <yearsactive></yearsactive> 
    <born></born>
    <formed></formed>
    <biography></biography>
    <died></died>
    <disbanded></disbanded>
</artist>


3.3 Sample nfo

An example of the artist.nfo is provided below. Click Expand to view.


4 Albums

This section deals with the requirement for the album.nfo file.


4.1 nfo Tags

The following table lists the available tags that can be used in the album.nfo file.


NFO (xml) Tag Required Overwrites * Multiple ** Notes
<album></album> Yes No No The top level parent tag for the nfo file. All other tags must be contained within these two tags
<title></title> No Yes No
<musicBrainzAlbumID></musicBrainzAlbumID> No No No Exported but tag not merged when scanned
<musicbrainzreleasegroupid></musicbrainzreleasegroupid> No No No
<scrapedmbid></scrapedmbid> No No No
<artistdesc></artistdesc> No No No Exported but tag not merged when scanned
<genre></genre> No Yes Yes
<style></style> No No Yes
<mood></mood> No No Yes
<theme></theme> No No Yes
<compilation></compilation> No Yes No
<review></review> No No No
<type></type> No Yes No
<releasedate></releasedate> No No No Empty XML tag exported, not not used when scanned
<label></label> No Yes No
<thumb preview="path"></thumb> No No Yes Path to available online artwork
Importing will also accept paths to local art files which can subsequently be exported
<path></path> No No No Exported but tag not used when scanned
<rating max="10"></rating> No No No Optional qualifier gives maximum value score is out of
<userrating max="10"></userrating> No No No Optional qualifier gives maximum value score is out of
<votes></votes> No No No
<year></year> No Yes No
<albumArtistCredits>
  <artist></artist>
  <musicBrainzArtistID></musicBrainzArtistID>
</albumArtistCredits>
No Yes Yes Scraped album artist credits can replace those derrived from music file tags.
Note even when overwrite is disabled missing album artists will be added
<releasetype></releasetype> No No No Exported with value "album", not used when scanned. </br>

This is an internal flag.

Notes
* If the setting Prefer Online Information in Settings>Media>Music. If enabled, these items may be overwritten in the library database.
** With multiple value fields those values are entered using an XML tag per value. When no data exists the XML tag will not be created on export


4.2 Template nfo

A template NFO File is provided below that can be copied into your own file and completed.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<album>
    <title></title>
    <genre></genre>
    <style></style>
    <mood></mood>
    <theme></theme> 
    <compilation></compilation>
    <review></review>
    <type></type>
    <label></label>
    <rating max="10"></rating>
    <userrating max="10"></userrating>
    <votes></votes>
    <year></year>
    <albumArtistCredits>
        <artist></artist>
        <musicBrainzArtistID></musicBrainzArtistID>
    </albumArtistCredits>
</album>


4.3 Sample nfo

An example of the album.nfo is provided below. Click Expand to view.


5 Technical Details

The information in this section is provided for technical interest and reference only. It can be safely disregarded if you have no technical interest in nfo and database functions

  • The data within the nfo file should, theoretically, all go to/come from somewhere in the database but, because the content source of the data field can be diverse, the data does not always come from a single source or go to a single database field. Scanning is not just about reading data but processing it too. As some fields are initially set from tags and can then be overwritten by nfo data, there is also a merge process involved in scraping.
  • There exist peculiarities with some XML tags in the nfo files:
    • <name> in artist.nfo can overwrite the name of the artist in the artist table, if "prefer online info" is "enabled", but does not change that name anywhere else
    • <releasedate> is required as part of the internal function of the online scraping process. It does not map directly to any db field, and nothing (currently) happens with its data. Exporting the library to nfo files will create an empty XML tag. It is not used during import/scrape.
    • <artistdesc> tag in the album.nfo file is related to the strArtists field of the album table of the database. It is derived from ALBUMARTIST and ALBLUMARTISTS tags from the music file tags. If those two tags are empty, then it will be derived from ARTIST and ARTISTS tags in the music files. It is exported to album.nfo as <artistdesc> but the value is not imported/scraped.
    • <releasetype> appears in the album.nfo by mistake. It is an internal flag that, in nfo files, will always be output as <releasetype>album</releasetype>, and it is ignored during import/scrape of the nfo file. It relates to the strReleaseType field of the album table in the database. It does not relate to the RELEASETYPE tag in the MusicFile, which connects to <type> in album.nfo.
    • <track> XML tag, and its children tags in the album.nfo, are not related in any way to the songs in the music library or in the Song table of the database. This XML tag and its children are related to the albuminfosong table which simply provides more descriptive details of the album, which can be displayed by some skins. The presence of <musicBrainzTrackID> under <track> is a mistake and is always empty. It is recommended that when creating your own nfo, that these XML tags be omitted from the album.nfo. These XML tags have been removed in v18.
  • There are music file tags that are not saved to the database, therefore there are no XML tags. The music file tags are accessed by the music player at the commencement of playback.
Music File Tags Not Stored In DB
LYRICS
REPLAYGAIN_TRACK_GAIN
REPLAYGAIN_ALBUM_GAIN
REPLAYGAIN_TRACK_PEAK
REPLAYGAIN_ALBUM_PEAK
  • In music the only XML tags with a qualifier is Rating and User Rating. It limits the maximum score that is possible for the given rating. This is relevant as Kodi switched from a maximum 5 rating to a maximum of 10 rating.
  • A FLAC file can have a cuesheet embedded in the CUESHEET tag. In v17 and prior there is a Cue table in the Database to make possible replaygain handling during playback for those kinds of files, but this slowed down Kodi for all users, even when no cuesheets were in the music file. v17 removed ReplayGain handling, so there is no replay gain applied for songs from FLAC with embedded cuesheets. This made the songs node 30% faster. This function has been redesigned and will be re-implemented in v18.




Return to top