5 Library Scanning
Rob Szarka edited this page 2016-07-02 19:04:18 -04:00

Scanning files and Clementine's database

When you first add a folder to your library in the Preferences dialog, Clementine will scan it and all its subfolders looking for media files. Every correct media file will get into your library with all of its metadata, whether the metadata is coming from the media file itself (things like ID3 tags) or from another source like is the case with CUE associated songs.

All the metadata goes straight into your Clementine's database. The database is the heart of Clementine. It let's us, developers, provide you with features like a view of your songs in form of a tree-like structure (that's the Library view), fast lookup of songs you need, ability to create smart playlists filtered by various conditions etc.

Of course, most of the data in the database can and will change with time. You can do things like: update a song's metadata, move an album under 'Various artists', change its cover art or you can just play music. The last one affects the database because we're keeping things like the last played time, play count and score there.

Remember that when you're removing a folder from library, you're also removing all the statistics associated in the database with it. You'll always be able to add the folder to the library again but the statistics are gone forever.

Monitor library for changes

In "Preferences / Music Library", there's a "Monitor library for changes" option.

Turning it on will make Clementine watch your library FOLDERs for changes. If a folder monitor notifies Clementine of change, the player will rescan that directory and all of its subdirectories.

During a scan, only the files for which their mtime (modification time) has changed since the last scan, will get examined. This of course includes files not yet in the library and those library files which got deleted. Other library songs won't go through any changes.

Please remember that we're not watching your FILEs for changes, only FOLDERs. This is by design due to shortage of resources on many filesystems.

What this means is that not every change will get noticed - only those which somehow "touch" the folder will trigger a partial rescan. The behaviour of Clementine depends on your filesystem here but the bottom line is - you should be aware of that issue.

If you cannot seem to force Clementine to update a song, try one of these methods:

  • add or remove a file from the folder that contains your song
  • rename the folder that contains your song or readd it to your library (be aware that those methods will remove the statistics associated with all of the folder's songs)
  • a "Full library rescan" will make sure the song is updated but it takes some time depending on size of your library

Also, remember that if you have "Monitor library for changes" option off, you'll need to run "Update changed library folders" action manually every time you'll want to see library changes applied.

Update changed library folders

This menu option scans all your library roots in search for changes. If it finds a change in a folder's mtime, the scan goes deeper. This of course suffers from the same issues that were described above - the depth of search depends on modification times of folders.

You should treat the feature like a helper and not the ultimate problem solver. It's lightweight but in some cases won't help Clementine see the changes you made (especially using some external tool).

The workarounds above apply here too but to make them fully work you'd need to apply those on every level of the tree of your library folders.

This type of scan is launched during Clementine's startup, when you have the "Update the library when Clementine starts" option on ("Preferences / Music Library").

Do a full library rescan

This feature is your last resort will-work-in-any-circumstances friend.

This type of scan treats every folder it goes through and every file in all of the folders like they've changed since the last scan which of course means, everything will get updated to the current version. The most important thing here is, your statistics (like rating or playcount) will be preserved.

The full collection rescan goes through all your library roots and all of their subfolders. Obviously this might take some time, especially when your library is huge but still we'd recommend doing a full rescan every now and then.