- Way to produce metadata
- Metadata overriding
- Properties overriding
Way to produce metadata
Component supports two ways to produce metadata. First one is to map video properties to metadata fields as is. Second one is to parse video title and extract metadata out of it. Video properties mapping is default way, because it gives consistent results for all videos. However if you mostly or always play music from Youtube, consider using video title parsing way.
Video properties mapping
For tracks representing video clips this approach is straightforward: use channel title as
%artist% and original video title from the site as
Tracks, representing playlists, channels and search, have more metadata fields. In addition to properties like title they include info about number of items and current position.
|Metadata||Channel track||Playlist track||Search track|
|%title%||channel title||playlist title||search query string|
|%album_artist%||-||title of the channel where this playlist comes from||-|
|%tracknumber%||index that would have the first item obtained from this track|
|%totaltracks%||number of playlists in the channel||number of videos in the playlist||number of search results|
|%discnumber%||index of this portion, like page number for search results on the site|
|%totaldiscs%||total number of portions|
Additionally track duration represents number of items in this portion, one second represents single item.
Parsing original title
In context of metadata there is not much you can rely on when getting video from the site. In most cases the only reliable text there is a video name given to it by the person who had uploaded it. And many music videos have title of the form similar to "%artist% - %title%" e.g. "Manowar - Mountains".
The idea behind this way of producing metadata is to split video title to multiple metadata fields. Edit box
Metadata Pattern contains the rule used when splitting video title.
This rule is a regular expressions with named subexpressions. If subexpression matches to non-empty string, this string is used as metadata field value and subexpression name is used then as metadata field name.
Video title must fully match regular expression. Otherwise no metadata is added.
Metadata can be overridden on URL basis. This can be done by extending video URL with pairs
field is metadata field name prepended with
fb2k_ prefix (to distinguish metadata fields from regular URL parameters). Like any other URL parameters, these should be separated by ampersand and should use percent-encoding when needed (expected character encoding is UTF-8).
If URL has
fb2k_ fields, none of the ways to produce metadata is applied to it.
foobar2000 uses two properties to identify the track: location and subsong index. Two tracks are treated as identical if these properties are equal for them. In context of metadata overriding this brings a question how to make two tracks referencing the same video page but having different overridden metadata to be different in foobar2000 context. If they will not be different then metadata update of one of them will automatically trigger update to the same values for the other one.
Solution taken by the component is to make them different from foobar2000 point of view. All given
fb2k_ field become part of track location string.
Track properties also can be specified when adding video URL. This is done similarly to metadata overriding except that the prefix is
fb2kx_. Also unlike
fb2k_ fields these ones do not become part of track location string. Component strips them from URL before creating track and stores corresponding properties in the cache (without overwriting existing ones).
Possible values for track properties are the same as in custom metadata fields except that the suffixes are different (for example, to specify view count one should use
fb2kx_view_count). One addition here is
fb2kx_length property, using which one can specify the track length (in seconds). Example (track length is 5 minutes 39 seconds):