Maintaining the same IDs for updated files and playlists

The <ChangedFilesHaveConstantId> element allows you to force mm-sync to keep the same ID values in the database for media and playlist files that are found to 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 synchronizes it accordingly, adding a table entry with a new file ID. For new media files, it's a files table entry with a unique fid value. For new playlist files, it's a playlists table entry with a unique plid value. When the <ChangedFilesHaveConstantId> enabled attribute is set to true, the files pass does not consider media files and playlists with changed sizes or modification dates as new, but maintains their file IDs and sets their accurate fields to zero to indicate the file metadata might have changed.

Thus, if you configure mm-sync to maintain constant file IDs for a changed media or playlist file, you must check the file's accurate field before you can use its metadata. If the accurate field is zero, then 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 zero, regardless of the <ChangedFilesHaveConstantId> setting.

Playlist synchronization behavior

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