User Tools

Site Tools


library_scanning_mechanism

Scan overview

Serviio (since 1.5) uses an optimised scanning mechanism for managing it's media library. When the server starts (or user clicks Force refresh) it runs a Manual scan. Once that has finished it then keeps the library up-to-date using a Delta scan.

Manual scan

Manual scan is automatically started on the server start-up. That is, unless you uncheck the 'Keep library automatically updated' checkbox. It checks all shared folders (which are currently available and connected) and compares their files with the current state of the media library. It performs any additions / deletions and updates (if 'Search for updates of currently shared files' is enabled). This operation may take some time for large libraries.

The Force refresh button will kick off this scan.

Manual scan is often required and forced when upgrading to a new Serviio version.

Delta scan

Once the Manual scan has finished, Serviio registers all your available shared folders for Delta scan (again, only if you enable 'Keep library automatically updated'). This process will hook into to OS level file monitoring and will perform addition / updates and removal of files in real-time as they happen.

Once a folder is registered to this mechanism, you will see this in your log:

Added repository XXXX to delta scanner (NATIVE)

In some cases, the OS level monitoring is not available to Serviio (e.g. some remote drives), in which case Serviio uses it's own polling mechanism to mimick this behaviour. The results will be almost the same, apart from a longer delay in the event detection (up to a minute) and possibly higher CPU load spikes for large libraries.

Once a folder is registered to this mechanism, you will see this in your log:

Added repository XXXX to delta scanner (POLLER)

The default frequency for polling in this case is 1 minute (ie Serviio will pause for 1 minute after each polling cycle has completed). You can change this via the serviio.libraryPollerFrequency system property (in number of minutes).

Delta scanner on Macs and FreeBSD

Due to current Java implementation, the NATIVE scanner is not available on these platforms. POLLER is used for all shared folders on these systems.

Forcing POLLER scanner

Sometimes NATIVE scanner doesn't work. That is especially the case in some combinations of the host operating system and shared remote drives (e.g. Samba/CIFS mapped drives on Linux). If you don't see any automatic updates, try forcing POLLER mechanism by selecting the checkbox on the details page of the Shared Folder.

External drives management

Serviio now manages remote drives in a safer way. Once the shared folder is not available (e.g. the drive is disconnected or has not been mounted yet during the OS boot-up) it will NOT remove all the files from the library. You will still be able to see them on your device but playing them will cause in error.

Once the drive becomes available, Serviio will detect it (within a few seconds) and add it to Delta scan.

If you want to remove the drive from Serviio, simply remove it from your Shared folders in the console.

Ignored folders

If you want to omit some folders (and their subfolders) from being indexed, just create an empty file .nomedia in the folder.

library_scanning_mechanism.txt · Last modified: 2024/06/07 18:31 (external edit)