KODI MUSIC MEDIA MANAGEMENT: Adding/updating and removing your media files

QuadraphonicQuad

Help Support QuadraphonicQuad:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.

HomerJAU

Moderator: MCH Media Players
Staff member
Moderator
Moderator
Joined
Jun 13, 2013
Messages
6,767
Location
Melbourne, Australia
Introduction: A brief recap on my previous posts:
Kodi has always stored media file information and metadata in database (by default the database on the Kodi device, but it can be set to a NAS or server to be shared by multiple Kodi devices).

When you view your Music media collection in the Kodi User Interface (UI), you are looking at a database view. This makes for instant access to everything in your collection. The views are preconfigured and customisable. Users get instant UI updates when switching between views by Artists, albums etc By Atmos, Quad, etc Or by Recently added, Genre, Year, a release date range, combos of any of those "Rock albums in the Seventies' etc.

At the simplest level, Kodi stores 'Albums' and files in its database by tags: AlbumArtist + Album (the Album name/title). It does not look at folders on a drive or file's folder. This means Kodi can show you anything all at once almost instantaneously. Of course, when a user selects media to play, Kodi has the Albums' tracks (files and folder path) in its database, so it knows where to find them and plays each track.

Kod's database contains folder and files locations along with all the music metadata from your music files’ tags. Kodi needs tags and lots of them to get the best possible UI experience for your Media Player:

https://www.quadraphonicquad.com/fo...cial-edition-media-players.37171/#post-835868

Source Folders:
Kodi needs to know where your media files are stored (which disk drive(s) and what folders to look at. Kodi calls these folders: 'Sources' or Source Folders.

A Kodi Source folder is usually a Root folder (a folder at the top of disc's folder tree structure).

In the two examples shown below, folders 'Music (A)' and 'Music 'B' are both Root Source folders:
MusicSourceFolders.png


Kodi Sources (as defined in Kodi) can be one of 4 Source Types: Music, Movies, TV Series or Music Videos.

The source type enables Kodi to load it's media databases correctly (if a file is under a Music source, treat it as a Music file, try and read Music Tags and music metadata and import that data into the Music database). If files are under a Movie Source then read the folders/files as movies and find movie metadata and load it into its Video database.

This document will address Music sources only.

PART 1: Adding a new Kodi Music Source Folder
This document assumes you have tagged files and your files are in folders under a 'Source' folder on a disc drive, all ready to feed Kodi.

The disc drive can be:
  • An external USB drive
  • A drive in a PC or Mac (you can access over your home network)
  • A NAS server's "Shared' volume (you can access over your home network)
  • Any mixture of the above
Multiple Music 'Source' folders are supported, on multiple discs or on the same disc.

NOTE: If you plan to use multiple attached external USB drives, each must have a unique 'Volume Label' (Kodi uses that label to identify each disc)

NOTE: For simplicity, the examples shown here are an attached external USB drive attached to a test NUC. The principles are identical, no matter where your media is stored.


METHOD 1: (The fast way - recommnded)
Ensure you have attached your external USB drive (Or allowed access to you networked drives, have passwords etc)

Kodi manages its Media Source folders from its SETTINGS window (from the SYSTEM main menu node - yes I know, why is it called 'System' when it actually 'Settings'? because its always been like that! - shrugs)

Media is managed from settings category node MEDIA. Here is the Kodi SETTINGS window, with MEDIA highlighted:

SETTING-Media1.png


Navigate to that MEDIA node and click: OK

The MEDIA settings window is displayed (see below):

The left Sidebar menu shows MEDIA setting categories. With Library category selected the right Setting Panel displays Library Settings:
Settings-Media-Music1.png


Navigate to the Libray - Music settings category item (as highlighted above) and click: OK

Kodi opens a list of all its existing Music library Sources:
Settings-Media-Music2.png


There are 3 items listed here:
Music: This is a special Source folder on the Kodi device that is pre-configured in all Kodi installations. It is empty for a new Kodi install​
Toshiba_Ext: This is the name of the external USB drive that is plugged into the test NUC (you USB drive will likely have a different name)​
Add music.... This is a 'command' that allows users to select an existing folder from anywhere the Kodi device can find​
To select a folder o your external USB drive:
Navigate to the external drive name in the list and click: OK

Kodi displays the root folders on the selected USB drive:
screenshot00006.png


NOTE: There are two extra normally hidden system folders on the USB drive ($Recyvle.bin & System Volume Information) created by Windows when I formatted that drive.

This is my Demo drive, so it shows 3 x Root Music folders (for those who read my Kodi Folder/File How To, you will remember those three Folder Structures described).

To Create a Music Source folder:
Navigate to the folder, with it highlighted click: 'Long OK' (Long means; click and hold the button until an action occurs, in this case it pops-up a Context menu, as shown next:
screenshot00007.png


In the previous image, I 'Long Clicked' OK on the folder 'Music (A)' and the Context menu is shown.
Navigate to: 'Scan Item to library' and click: OK

Kodi shows a dialog with the following question:
screenshot00009.png


This method as described combines two Kodi actions:
Click Yes - Kodi will add the selected folder (Music (A) to its database as a Music Source AND Scan the contents of all sub-folders looking for new content
Click; No - Kodi will just add the selected folder (Music (A) to its database as a Music Source

SCAN: This is the name Kodi uses to describe the following:
Recursively search every sub-folder under the Source folder, to fin every file in every folder and (for a Music source), read all music tags and file data (file name, type, audio data etc)
Check each file it finds: Is it already in the (music) database: If not add it. If it exists Update the data if has changed since it was last updated*
* Kodi combines files with matching tags into Albums in its database.

Scans are very fast, the Kodi developers have really optimised the recursive tag reading.

SCRAPE When Kodi has completed the Scan process for the Source. If a specific option is set (more later): Kodi will do a 2nd Pass and for each Album and begin SCRAPING metadata - Searching for additional metadata from various online websites to fully populate its database with all sorts of great information: Artist biographies, discographies, composers, music instruments etc and fetch artist images etc All of which can be displayed when using Kodi. Scraping is time consuming (it rate limited to stop just a few users hogging valuable server resources, rate limiting allows other users to get their data too, without completely flooding the servers).

It is Recommended to NOT to perform a SCAN and a SCRAPE at same time. Do just a Scan (all your media will be imported into the database quickly and you can search and play music immediately. Perform the SCRAPE while you are playing music or doing something else.

As soon as the SCAN is completed you can navigate back the MUSIC main Kodi menu and all your scanned files will be in the music library. ('Back' button, goes back one window at a time, or 'Home' button straight to main menu)


PART 2: Updating Kodi Library Data when Media files are changed
There are scenarios where a user has changed media files:
  • Media files are retagged (correctly info, adding Musicbrainz tags etc)
  • A user changes files for an album (e.g. bought a new CD or BDA with better mastering or better mix) (how many versions of the same album do we need (yea, "all of them" I can hear! Really?)
In these situations, with just one or two albums updated, or if you have just added only one or two new albums, its easier and faster, just:
Navigate to to Settings, Media, then the Music (see the 3rd image in this post),
then for each changed or new album,
navigate to the album folder you wish to update,
Long click OK on the album folder, from the pop-up Context menu select; Scan items to library (as shown below):
MediaAlbumForcedScan1.png


Then in the confirmation dialog, select YEs to force Kodi to do a full Scan of existing files (re-read and save tags to the database) and find new files.:
MediaAlbumForcedScan2.png


That is a very fast scan as its only reading the few files in that selected album's folder.

Do that for the few updates/new albums and you are all good to go!


PART 3: Removing Media from the Kodi Library database
There are scenarios where a user wants to remove media from their Kodi library:
  • A user deletes folders and/or media files
  • A user moves media files or folders to a new Source (including another disc drive)
  • A user renames an album folder or files in an existing folder
In all these situations Kodi's database still has data pointing to folders and files that no longer exists. If you attempt play a file Kodi will not find it, and can't play it of course, I
In the case where an album folder has been moved, a Kodi SCAN will find the new folder/files ok, but will duplicate the album in its database, adding to the old folder/file definition it scanned previously.

To remove albums (folders and files) from the database that no longer exist in their original folders:

Go to the MEDIA settings window:
With the Library sidebar category selected, scroll down on the right Library setting panel to Music Library section as shown:
CleanMusic.png


Click on: Clean Library (as shown above)

This does an extremely fast lookup of every file in the Kodi library vs. its file path, if the file does not exist remove from the library, if all files for a Album don't exist, remove the Album from the library,

Done!


PART 4: Adding Albums any time you want, Or after adding Many new Albums:
One you have created a Music Source in Kodi you can freely copy new rips, albums etc under any Kodi Source folder on a drive, then do a bulk SCAN from most Kodi UI views (where you play music, you dont have to go throught the MEDIA settings window:

For example here is the Artist view for an Artist with two albums
MusicSidbarMenu.png


In views like this, using you remote click left until the left sliding menu pops out (as shown below):
MusicSidbarMenuScan.png


Near the bottom om that side menu, click: Update Library

That requests Kodi to do a SCAN of all Music Sources (looking for new albums/files added since the last time a SCAN was requested.

All new albums will be found and added to you Kodi music Library.


HINT: The Kodi UI has an option: 'Recently Added Albums'. Click on that and you'll get a list with most recent at the top.
 

Attachments

  • MusiSettings-SetScraping.png
    MusiSettings-SetScraping.png
    346.4 KB
Last edited:
Enabling/Disabling metadata SCRAPING during a SCAN in Kodi Settings:
At any time a user can enable or disable the Scraping task by navigating to the Settings -> Media setting window, then on the left Sidebar menu, navigate down to 'Music" like this:
EnableSraping.png


With the Music sidebar category selected, the music media setting 'Fetch additional information during updates' enables/disables Scraping during a Scan
 
  • Like
Reactions: PK
Status
Not open for further replies.
Back
Top