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

The <Configuration>/<Database>/<Synchronization>/<ConfigurableMetadata> element configures metadata support. For each metadata field you want to store in the database, you must define a <metadata> element, contained in <ConfigurableMetadata>, that maps the field read from the metadata provider to the database storage field and defines other metadata parameters.

The <metadata> elements have the following attributes:

Attribute Description
ftype Declares the media type for the metadata. Acceptable values are audio, video, and photo.
table Names the database field that stores the metadata you want to synchronize. The table name is listed first, followed by a dot (.), and then the field name. For example, a table value of video_metadata.width tells mm-sync that the metadata is destined for the width field in the video_metadata database table.
ext_table (Optional) Identifies the table and field (column) that stores the values for this bit of metadata. This table is considered external because it's separate from the main metadata table. For instance, an ext_table setting of artists.artist instructs mm-sync to store the metdata value (in this case, the artist name) in the artist column of the artists table. When you define this attribute, you must also define ext_table_rel.
ext_table_rel (Optional) Identifies the field that relates external table entries to metadata table entries. For instance, an ext_table_rel setting of artists.artist_id instructs mm-sync to store the artist_id field (and not the artist name) in the metadata table and to store the artist name in the external table entry with the matching artist_id setting. When you define this attribute, you must also define ext_table.
md_map Names the metadata provider fields to synchronize to the database. The metadata provider name is listed first, followed by the AT sign (@), and then a comma-separated list of applicable field names. Details for multiple metadata providers may be separated by a semicolon. For example, an md_map value of libmd@artist,albumartist;ipod@artist; tells mm-sync the current mapping applies to the artist and albumartist fields from the libmd metadata provider and the artist field from the ipod metadata provider. Note that metadata is matched in left-to-right order. In this example, then, if both the "artist" and "albumartist" fields are available from libmd, only the "artist" field will be used.
maximum (Optional) Limits the length of the metadata strings that mm-sync writes to the database. By default, the length is limited to 256 characters. When used, this attribute sets the maximum number of bytes for a metadata string that can be stored in the database field named by the table attribute.

Storing metadata field values in external tables

For metadata fields with values that are often repeated for different media files, such as artist or genre, you can save space and improve performance by storing the field values in an external table and using an index in the main metadata table to refer to specific field values. Suppose a mediastore contains several tracks whose artist is "Jamiroquai". Instead of replicating this string in many metadata table rows, you can store a single copy of the artist name with its associated artist index in an external table, and then store this same index in all metadata table entries representing tracks by "Jamiroquai". Storing indexes instead of strings reduces the size of each metadata table row and also allows you to sort the metadata faster because index comparisons are considerably faster than string comparisons.

For an individual media file, you can find its setting for any metadata field whose values are stored in an external table by joining the metadata table with the external table on the field named by ext_table_rel. Suppose you have an external table genres for storing the names of musical genres and a field genre_id for relating external table entries to audio_metadata table entries. If you want to list all tracks for a given genre, say "Pop", you can join these two tables on the genre_id field and filter the results based on the genre name matching "Pop".