Maintaining constant IDs for updated files and playlists

The <ChangedFilesHaveConstantId> element in the configuration file and the dynamic_folder option in the command for starting a synchronization both force mm-sync to keep the same IDs in the database for files that have been modified.

By default, during the files pass of synchronization, mm-sync treats any media or playlist file whose size or date has changed as new and resynchronizes it, adding a table entry with a new file ID. For media files, it's a files table entry with a unique fid value. For playlist files, it's a playlists table entry with a unique plid value.

When either the <ChangedFilesHaveConstantId> configuration setting or the dynamic_folder option is enabled, the files pass does not consider media files and playlists with changes in size or modification date as new. No new database entries are added and the file IDs are maintained, but the accurate field is set to 0 for each existing entry, to indicate that the file's metadata might have changed. In this case, you must check a file's accurate field before using its metadata. If the field is 0, the file requires a metadata or playlist synchronization pass.

This setting slows down the files pass of synchronization when the filesystem has changed, but is necessary for legacy media applications that aren't designed to accommodate the file ID changing when a file is modified.

Note: For media files not successfully synchronized during the metadata pass or for playlist files not successfully synchronized during the playlist pass, their accurate field will be set to 0, regardless of the <ChangedFilesHaveConstantId> or dynamic_folder setting.

Playlist synchronization behavior

Playlist synchronization differs from media file synchronization in the following ways: