Difference between revisions of "User:Karellen/scratchpad"

From Official Kodi Wiki
Jump to: navigation, search
(Music Album nfo: change album.nfo example)
Line 360: Line 360:
 
{{collapse top| Music Album nfo file  (click 'expand' to view)}}
 
{{collapse top| Music Album nfo file  (click 'expand' to view)}}
  
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<title>Gold: Greatest Hits</title>
+
<album>
        <musicBrainzAlbumID>09cc6e86-9901-40f0-a53e-a638e95744ba</musicBrainzAlbumID>
+
    <title>Symphony no. 5 & The Water Goblin</title>
        <artistdesc>ABBA</artistdesc>
+
    <musicBrainzAlbumID>df943086-8bb9-41fa-a984-b70be7286701</musicBrainzAlbumID>
        <genre>Pop</genre>
+
    <artistdesc>Dvo┼Ö├ík; SNO, J├ñrvi</artistdesc>
        <style>Rock</style>
+
    <genre>Classical</genre>
        <style>Pop</style>
+
    <genre>Romantic</genre>
        <mood>Cheerful</mood>
+
    <style>Pastoral</style>
        <compilation>false</compilation>
+
    <style>Old and slow</style>
        <review>Gold: Greatest Hits is a greatest hits album of recordings by Swedish pop group ABBA. It was released on 21 September 1992... </review>
+
    <mood>Happy</mood>
        <type></type>
+
    <mood>Dramatic</mood>
        <releasedate></releasedate>
+
    <theme>Fantasy theme of water gobin</theme>
        <label>Polydor</label>
+
    <theme>Gratefulness</theme>
        <thumb preview="http://www.theaudiodb.com/images/media/album/thumb/gold-great...b2.jpg/preview">http://www.theaudiodb.com/images/media/album/thumb/gold-great...b2.jpg</thumb>
+
    <compilation>false</compilation>
        <path>E:\Music-Picard\ABBA\Gold\</path>
+
    <review>Dvo┼Ö├ík composed his fifth symphony in the summer months in June and July 1875. The opus number is actually incorrect. The autograph was marked with number 24, but the publisher Simrock (ignoring the protests of the composer) gave this symphony a high number of 76</review>
        <rating max="10">-1.000000</rating>
+
    <type>album; live recording</type>
        <userrating max="10">-1</userrating>
+
    <label>Chandos</label>
        <votes>1658</votes>
+
    <thumb preview="http://www.theaudiodb.com/images/media/album/thumb/uuvuvt1389633744.jpg/preview">http://www.theaudiodb.com/images/media/album/thumb/uuvuvt1389633744.jpg</thumb>
        <year>1979</year>
+
    <path>N:\Music\Lib\Classical\Dvo┼Ö├ík\Symphony no. 5 , The Water Goblin\</path>
        <albumArtistCredits>
+
    <rating max="10">3.500000</rating>
            <artist>ABBA</artist>
+
    <userrating max="10">6</userrating>
            <musicBrainzArtistID>d87e52c5-bb8d-4da8-b941-9f4928627dc8</musicBrainzArtistID>
+
    <votes>502</votes>
        </albumArtistCredits>
+
    <year>1987</year>
        <track>
+
    <albumArtistCredits>
            <musicBrainzTrackID></musicBrainzTrackID>
+
        <artist>Anton├¡n Dvo┼Ö├ík</artist>
            <title>Dancing Queen</title>
+
        <musicBrainzArtistID>819eaeb2-8dd8-48a5-ad07-0bcd137985ef</musicBrainzArtistID>
            <position>1</position>
+
    </albumArtistCredits>
            <duration>03:52</duration>
+
    <albumArtistCredits>
         </track>
+
        <artist>Scottish National Orchestra</artist>
        <track>
+
        <musicBrainzArtistID>c6c4103b-cf07-42ad-91a7-b7eab7586e56</musicBrainzArtistID>
            <musicBrainzTrackID></musicBrainzTrackID>
+
    </albumArtistCredits>
            <title>Knowing Me, Knowing You</title>
+
    <albumArtistCredits>
            <position>2</position>
+
         <artist>Neeme J├ñrvi</artist>
            <duration>04:02</duration>
+
        <musicBrainzArtistID>8a1d9496-603f-40b1-a38d-2e8985834940</musicBrainzArtistID>
        </track>
+
    </albumArtistCredits>
         <track>
+
    <track>
            <musicBrainzTrackID></musicBrainzTrackID>
+
         <musicBrainzTrackID></musicBrainzTrackID>
            <title>Take a Chance on Me</title>
+
        <title>Symphony no. 5 in F major, op. 76: I. Allegro ma non troppo</title>
            <position>3</position>
+
        <position>1</position>
            <duration>04:04</duration>
+
        <duration>12:50</duration>
        </track>
+
    </track>
        <track>
+
    <track>
            <musicBrainzTrackID></musicBrainzTrackID>
+
        <musicBrainzTrackID></musicBrainzTrackID>
            <title>Mamma Mia</title>
+
         <title>Symphony no. 5 in F major, op. 76: II. Andante con moto</title>
            <position>4</position>
+
         <position>2</position>
            <duration>03:33</duration>
+
        <duration>07:49</duration>
         </track>
+
    </track>
        <track>
+
    <track>
            <musicBrainzTrackID></musicBrainzTrackID>
+
         <musicBrainzTrackID></musicBrainzTrackID>
            <title>Lay All Your Love on Me</title>
+
         <title>Symphony no. 5 in F major, op. 76: III. Scherzo. Allegro scherzando</title>
            <position>5</position>
+
        <position>3</position>
            <duration>04:34</duration>
+
        <duration>07:39</duration>
        </track>
+
    </track>
         <track>
+
    <track>
            <musicBrainzTrackID></musicBrainzTrackID>
+
        <musicBrainzTrackID></musicBrainzTrackID>
            <title>Super Trouper</title>
+
         <title>Symphony no. 5 in F major, op. 76: IV. Finale. Allegro molto</title>
            <position>6</position>
+
         <position>4</position>
            <duration>04:14</duration>
+
         <duration>12:08</duration>
        </track>
+
    </track>
        <track>
+
    <track>
            <musicBrainzTrackID></musicBrainzTrackID>
+
         <musicBrainzTrackID></musicBrainzTrackID>
            <title>I Have a Dream</title>
+
         <title>The Water Goblin, op. 107</title>
            <position>7</position>
+
         <position>5</position>
            <duration>04:44</duration>
+
         <duration>20:39</duration>
         </track>
+
    </track>
        <track>
+
    <releasetype>album</releasetype>
            <musicBrainzTrackID></musicBrainzTrackID>
+
</album>
            <title>The Winner Takes It All</title>
 
            <position>8</position>
 
            <duration>04:55</duration>
 
        </track>
 
         <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Money, Money, Money</title>
 
            <position>9</position>
 
            <duration>03:08</duration>
 
        </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>SOS</title>
 
            <position>10</position>
 
            <duration>03:21</duration>
 
         </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Chiquitita</title>
 
            <position>11</position>
 
            <duration>05:26</duration>
 
        </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Fernando</title>
 
            <position>12</position>
 
            <duration>04:13</duration>
 
         </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Voulez-vous (edit)</title>
 
            <position>13</position>
 
            <duration>00:00</duration>
 
        </track>
 
         <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Gimme! Gimme! Gimme! (A Man After Midnight)</title>
 
            <position>14</position>
 
            <duration>04:48</duration>
 
        </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Does Your Mother Know</title>
 
            <position>15</position>
 
            <duration>03:15</duration>
 
        </track>
 
         <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>One of Us</title>
 
            <position>16</position>
 
            <duration>03:58</duration>
 
         </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>The Name of the Game (edit)</title>
 
            <position>17</position>
 
            <duration>00:00</duration>
 
         </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Thank You for the Music</title>
 
            <position>18</position>
 
            <duration>03:51</duration>
 
         </track>
 
        <track>
 
            <musicBrainzTrackID></musicBrainzTrackID>
 
            <title>Waterloo</title>
 
            <position>19</position>
 
            <duration>02:42</duration>
 
        </track>
 
        <releasetype>album</releasetype>
 
    </album>
 
  
 
{{collapse bottom}}
 
{{collapse bottom}}

Revision as of 13:55, 8 September 2017

Steps to create your Music Library
1. Music File Tagging
2. Scanning Music Into Library
3. Scraping Additional Music Information
4. NFO Files
5. Music_artwork

Report NFO corrections:
[https:// here in the forum]

Home icon grey.png   ▶ Video library
▶ Music library
▶ scratchpad



1 Requirements

As the Music section of Kodi has many differences to the Video section of Kodi, please read this section to ensure your music and artwork are correctly scraped and displayed.


1.1 Understanding the Music Library

1.2 Adding Music to Library

1.3 Music nfo Specific Requirements

  • A number of database fields can be populated initially by music file tags, but then be overwritten by online or nfo scraping. Whether this occurs depends on the setting Prefer Online Information in Settings>Media Settings>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 or local nfo file scrape. The affected fields are shown below in the section Available nfo Tags.
  • In the album.nfo the top level <artist> tag has been deprecated and is not shown in any sample nfo files. Applies to v12 and prior.
  • 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.
  • FLAC rating contained within the Music File Tag is scored out of 100. Kodi converts this value to its equivalent value out of 10. Values less than 10 in the FLAC music file tag will return a rating of 0 in Kodi.


The information in the remainder of this section is provided for technical interest only. It can be safely disregarded if you have no technical interest in certain 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
MUSICBRAINZ_TRACKID
CUESHEET
LYRICS
REPLAYGAIN_TRACK_GAIN
REPLAYGAIN_ALBUM_GAIN
REPLAYGAIN_TRACK_PEAK
REPLAYGAIN_ALBUM_PEAK
METADATA_BLOCK_PICTURE or COVERART or COVERARTMIME
  • 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.


2 nfo Placement

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

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

For additional album artist information each artist needs a separate artist.nfo file located in what Kodi determines as the unique common folder for that artist. Kodi does not fetch additional artist data for artists that only feature on songs, either on compilation albums or as guest artists on songs in albums by others, and you do not have any albums by them in your collection.

Note: There are weaknesses in the way that Kodi determines the location of the artist folder. It looks for the folder that is common to all the songs with that album artist, the name of that folder is irrelevent. If you have multiple albums by an artist all under an artist folder then this works perfectly. However the algorithm does not work for collaboration albums, those that have more than one album artist e.g. "Riding with the King" by Eric Clapton and BB King, or classical music with composer, orchestra and conductor given as the album artist. Also if you have not kept all songs by an artist under a unique folder, then the artist directory will probably be mis-identified. The result is that Kodi can find the wrong artist.nfo file, and give the artist some other artist's information, or fail to fine the artist.nfo you created

Naming & Saving conventions for your Music Artist *.nfo files:

Saved Artist as File Name Save Location
Artist\Album\Songs artist.nfo f:\MyMusic\Stevie Nicks\artist.nfo


Naming & Saving conventions for your Music Album *.nfo files:

Saved Album as File Name Save Location
Artist\Album\Songs album.nfo f:\MyMusic\Stevie Nicks\Crystal Visions\album.nfo


3 Available nfo Tags

The following two tables list the available tags that can be used in each nfo file. The Album nfo section includes an example nfo for collaboration type albums.


3.1 Artist nfo

nfo (XML) Tag Required Overwrites Multiple ** Notes
<name></name> Yes 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
<genre></genre> No Yes Yes
<style></style> No No Yes
<mood></mood> No No Yes
<theme></theme> No Yes Yes
<yearsactive></yearsactive> No No Yes
<born></born> No No No
<formed></formed> No No No
<instruments></instruments> No No No
<biography></biography> No No No
<died></died> No No No
<disbanded></disbanded> No No No
<thumb preview="path"></thumb> No No Yes Path to available online artwork
<path></path> No No No
<fanart></fanart> No No Yes Path to available online artwork
<album>
  <title></title>
  <year></year>
</album>
No No Yes Path to artwork in use
<art>
  <fanart></fanart>
  <thumb preview="path"></thumb>
</art>
No No Yes Path to artwork in use
Notes
** With multiple value fields those values are entered using XML tag per value, and when no data exists, the XML tag will not be created on export



3.2 Album nfo

nfo (XML) Tag Required Overwrites Multiple Notes
<title></title> Yes Yes No
<musicBrainzAlbumID></musicBrainzAlbumID> No Yes No
<artistdesc></artistdesc> Yes No No XML Tag created on Export, not used on Import
<genre></genre> No Yes Yes
<style></style> No Yes Yes
<mood></mood> No Yes Yes
<theme></theme> No Yes Yes
<compilation></compilation> Yes Yes No
<review></review> No Yes No
<type></type> No Yes No
<releasedate></releasedate> No No No Empty XML Tag created on Export, not used on Import/scrape
<label></label> No Yes No
<thumb preview="path"></thumb> No No Yes
<path></path> Yes No No
<rating max="10"></rating> No Yes No
<userrating max="10"></userrating> No No No
<votes></votes> No Yes No
<year></year> No Yes No
<albumArtistCredits>
  <artist></artist>
  <musicBrainzArtistID></musicBrainzArtistID>
</albumArtistCredits>
Yes Yes Yes
<track>
   <musicBrainzTrackID></musicBrainzTrackID>
   <title></title>
   <position></position>
   <duration></duration>
 </track>
Yes Yes Yes Not related in any way to the songs in the music library.

It is used by the albuminfosong table which simply provides descriptive data used by some skins.
musicBrainzTrackID is exported in error and will always be empty.
Can be safely ignored if creating your own nfo files.

<releasetype></releasetype> No No No Appears by mistake. Is not used
Notes
** With multiple value fields those values are entered using XML tag per value, and when no data exists, the XML tag will not be created on export



4 Sample nfo Files

An example of the artist.nfo and the album.nfo are provided. Use these as a guide to create your own nfo files, or to determine errors in your own files.


4.1 Artist nfo

Sample Music Artist nfo. Click the Expand button, to the right, to view


4.2 Music Album nfo

Sample Music Album nfo. Click Expand, to the right, to view.


Return to top