The <Configuration>/<Database>/<Synchronization> element

The <Configuration>/<Database>/<Synchronization> element defines many synchronization settings, including resource optimization, the file types to include or exclude, the mapping of metadata provider fields to database fields, and policies for media data and playlists.

Table 1. Resource optimization elements
Tag name Attribute Default Description
<Priority>   0 Sets the priority of the foreground synchronization threads. A value of 0 assigns the default priority, which is the priority used by mm-sync at startup. Nonzero values assign absolute priorities.
<MergePriorityAdjust>   1 Sets the merge thread's priority adjustment. This value is added to the synchronization thread priority to derive the merge thread priority. The default behavior is to add 1 to the synchronization thread priority.
<MaxThreads>   8 Defines the maximum number of foreground synchronization threads permitted to run at a time.
<MaxRecursionDepth>   8 Sets the maximum directory depth to recursively search when synchronizing a mediastore. This setting also applies to priority folders.
<MaxSyncBuffers>   250 Specifies the maximum number of synchronization records in the buffers between the foreground and background synchronization threads. Having more buffers increases memory usage but speeds up synchronization.
Table 2. Database size management elements
Tag name Attribute Default Description
<ChangedFiles HaveConstantId> enabled off

When this setting is enabled, mm-sync ensures that media or playlist files with a size or modification date that has changed will keep the same ID values in the database. For these items, the files and playlists table entries will have their accurate flags cleared but no other fields will be changed. This strategy helps limit the database size by preventing new rows from being added whenever a file is changed; this occurs if the ID values are not kept the same.

For more information on how synchronization is impacted, see Maintaining constant IDs for updated files and playlists.

<StopOnDbLimit> enabled false Controls whether synchronization stops when a database limit is reached.
Table 3. Event elements
Tag name Attribute Default Description
<Events> folder trimonly Controls what optional events are delivered. Currently, only the delivery of folder events is controllable. Use trimonly to send events only when a folder object (file, folder, or playlist) is deleted. Use on to send events for folder object additions, modifications, and deletions. Use off to disable event sending.
<MaxFirstFidEvent>   1 Sets the maximum number of FIRST_EXISTING_FID events sent during synchronization. These events are sent during the files pass when mm-sync finds a media file that's playable and is already in the database. A value of n causes mm-sync to return this event for the first n existing files.
Table 4. Synchronization filter elements
Tag name Attribute Default Description
<SyncFileMask>   (empty) Defines a POSIX regular expression (regex) pattern for naming files that you do not want synchronized. Only one such element can be specified. The default setting is an empty mask, meaning no files are skipped during synchronization. For details, see Skipping files based on their names.
<NonMediaItems>     Controls the prescanning done on each folder. You can cause mm-sync to skip folders found by the prescan to have too much nonmedia content. The prescan parameters can be set in elements contained in <NonMediaItems>.
<OnDotNoMediaFile> action   Action to take when a .nomedia file is found in a folder. Acceptable values are skip (to skip the folder) and sync (to synchronize it).
eventOnSkip   Whether to report an error after skipping the folder.
<NonMediaItems>/<MaxItems>   0 Limits how many nonmedia files can be in a folder before it's skipped from synchronization. A value of 0 disables this limit.
consecutive false Specifies whether the limit of nonmedia files is consecutive. Usually, the file order is not guaranteed, so using a consecutive limit can yield nondeterministic results. When this attribute is false, as is the default, MaxItems is the limit of total files.
<NonMediaItems>/<PrescanLimit>   0 Limits how many files can be scanned when searching for media content in a folder. A value of 0 disables the limit and causes the entire folder to be scanned.
<MaxFolderItems>   0

Controls the maximum number of items read from a folder. This limit excludes “.” and “..”, but includes any items whose filenames match the pattern in <SyncFileMask>. A value of 0 disables this limit.

For details about which synchronizers use this field and the resulting behavior, see Limiting the number of items read.

<MaxFolderMediaItems>   0 Specifies the maximum number of media items read from a folder. This limit applies only to folder items (files, folders, or playlists) inserted into the database. A value of 0 disables this limit.
<MaxMediaStoreItems Configuration>    

Controls the maximum number of items read from mediastores. You must define a separate <MaxMediaStoreItems> child element for each mediastore on which you want to impose such a limit.

For details about which synchronizers use this field and the resulting behavior, see Limiting the number of items read.

<MaxMediaStoreItems Configuration>/ <MaxMediaStoreItems>   100 Limits the number of items read from a mediastore. This limit excludes “.” and “..”, but includes any items whose filenames match the pattern in <SyncFileMask>. A value of 0 disables this limit.
mediastore (none) Names the mediastore to which the limit of items read applies.
<MinFileSize>   0 Defines the minimum size, in bytes, needed for a file to be synchronized to the database. Files smaller than this threshold are skipped. A value of 0 disables this limit.
<extensions>    

Specifies which file extensions are supported, letting you filter the synchronization based on file type. This element contains the <playlists> element, which lists supported playlist extensions, and the <library> element, which lists supported media file extensions. Files with unlisted extensions aren't synchronized.

The contents and semantics of these child elements and their fields are described in Filtering synchronization by file type.

Table 5. Advanced configuration elements
Name Description
<ConfigurableMetadata> Defines the metadata provider fields that are copied into specific database fields. The mm-sync service has no special knowledge of this metadata but passes it along to the database.
<MSS> Contains elements that configure mediastore synchronizers (MSSs). Currently, only the synchronizers for Apple devices can be configured in this area.
<PLSS> Defines resource usage limits and filename-matching parameters for playlist session synchronizers (PLSSs). This element can also name a nondefault configuration file for the library that mm-sync uses to synchronize playlists.