How library indexing works, and what affects its speed
When you add a folder in settings > folders, Zunie reads every supported file it contains to build your library: tags, cover art and durations for music, durations and sizes for videos, dimensions for pictures. This step is called indexing (or scanning). This page explains how it works and why it can be fast on one computer and slow on another.
How a scan runs
A scan always runs in the background. You can keep browsing and listening while it runs, and new albums appear in your library as they are found.
- Looking for files. Zunie first goes through all your folders and subfolders to find the files it supports, and whose type is checked in settings > file types. It compares each file with what it already knows, using the file size and the date it was last modified. During this step, the progress shows that Zunie is counting files.
- Reading files. Zunie then reads only the files that are new or have changed. It reads up to 4 files at the same time and saves the results in small groups, which is why your library fills up little by little.
- Cleaning up. Files that no longer exist on disk, and files whose type you unchecked in settings > file types, are removed from the library.
- Video thumbnails. When the scan is over, Zunie creates a thumbnail for each new video, one video at a time. If a thumbnail cannot be created, Zunie does not try again for that video. Thumbnails are kept in Zunie's cache folder: if they are deleted, Zunie creates them again (see Where Zunie stores your library).
When the scan ends, a summary shows how many files were added, updated, removed and, if any, unreadable.
When Zunie scans
- When you add a folder, or click rescan in settings > folders or settings > file types.
- Each time Zunie starts, it runs a quiet scan to catch up with files you added since last time. Because only new and changed files are read, this scan is usually short.
You can stop a running scan at any time with cancel. What was already read stays in your library, and the next scan continues from there.
What affects indexing speed
The number of files
The first scan of a folder reads every file, so its duration grows with the size of your collection: from a few seconds for a small folder to several minutes, or more, for a large collection. Later scans only read what changed, and are much faster.
Even when nothing changed, Zunie still has to list every file to check its size and date. On very large collections, this listing step alone can take some time, especially over a network.
Network folders
Folders on a NAS or a shared drive are slower than local disks, because each file has to travel over the network to be read.
- A wired connection is faster and more stable than Wi-Fi.
- If a file takes too long to answer, Zunie gives up on it: after 8 seconds for a music file and 10 seconds for a video. The file is counted as unreadable, and Zunie tries it again at the next scan.
- If a whole folder is unreachable, for example because the NAS is turned off or the drive is unplugged, Zunie skips it and removes nothing from your library. Your tracks, playlists and history stay intact until the folder is back.
Processor and disk
Reading tags is light work, but reading 4 files at once keeps a few processor cores busy during the first scan. On a modest computer, you may hear the fan or feel the interface slow down a little until the scan ends.
Video thumbnails need to decode a few seconds of each video, which uses more processor time than reading music tags. A large video folder can keep the processor busy for a while after the scan itself has ended.
The files themselves
- Large embedded cover art makes each music file longer to read.
- Damaged files, or files that are not really in the format their extension claims, can take until the time limit before Zunie gives up.
Files Zunie ignores
- Files whose extension is not supported (see Supported formats and system requirements).
- Files whose type is unchecked in settings > file types. When you uncheck a type, the files of this type already in your library are removed from your collection and your playlists at the next scan. The files themselves stay untouched on your disk.
- Hidden files and folders, and system files.
- Folders your user account is not allowed to open.
Tips for a faster scan
- Add your folders and let the first scan finish once, ideally on a wired connection for network folders.
- Add only the folders that really contain media. Avoid adding a whole drive or your entire home folder.
- Keep music, videos and pictures in separate folders, and add each one with the matching button (add a music folder, add a video folder, add a pictures folder).
- If some files stay unreadable, check them in another player. Details are written to the log (see How to access Zunie logs).