At each synchronization pass, mm-sync traverses the mediastore filesystem to extract and upload media information into the mediastore's database. The section of the filesystem tree that is synchronized depends on the user-specified path. If a blank path is given and the recursive option is set, the entire filesystem is synchronized. Otherwise, only the files and folders named by the path are synchronized.
The filesystem traversal is done with a breadth-first walk of the mediastore's directory structure, as follows:
The following image shows the synchronization order for typical contents of a mediastore filesystem:
You can enable or disable the recursive option (MMSYNC_OPTION_RECURSIVE) in the call to mm_sync_start() or in the sync_start command. By default, this option is disabled, so you must enable it when you want to synchronize the entire mediastore or a whole directory subtree.
This traversal policy ensures that all folders with the same parent node are synchronized before folders deeper in the tree are examined. So mm-sync will display information on the contents in the root folder before it retrieves information on files in subfolders. This progressive information retrieval makes sense because end users often start at the filesystem root when they first access mediastores, and then descend into subfolders as they explore the media content.
The synchronization path provided by the client to mm-sync determines the synchronization startpoint (the root node in the walk). The path is relative to the mediastore filesystem. For example, the path The_Doors tells mm-sync to locate the object named The_Doors within the root folder. If the name refers to a file, only that file gets synchronized. If the name refers to a folder, the files it contains get synchronized; when the recursive option has been set, the subfolders also get synchronized.