I did not find any plugin(s) that would make it easy to add support for handling these fields. So I’ve turned to the plugin writing documentation to see what it would take to implement these fields. Am I correct in believing the section on extending MediaFile is all I would need to follow to write a plugin that could read/write these fields? By adding these fields to the MediaFile class would they be read and stored by the importer?
I’m not entirely sure what you’re asking, but the way these things work is that you create an internal beets name for your field, which can be anything you want, and describe how to map those onto actual tags for various formats. Needless to say, the mapping for ID3 and for Vorbis Comments is going to be different. But within beets, you only use the internal name.
We are on the same page… It is the mapping of the ID3/Vorbis Comments to the beets name that I am trying to understand… The reason for the confusion is the documentation example uses “foo” for everything (and since I am not as familiar with the internals of beets and mutagen, this isn’t exactly clear). So, here’s the example, modified for one case:
class FooPlugin(BeetsPlugin):
def init(self):
field = mediafile.MediaField(
mediafile.MP3DescStorageStyle(u’WOAF’),
mediafile.StorageStyle(u’WOAF’)
)
self.add_media_field(‘license’, field)
Or would I do it like this:
class FooPlugin(BeetsPlugin):
def init(self):
field = mediafile.MediaField(
mediafile.MP3DescStorageStyle(u’wwwfileinfo’),
mediafile.StorageStyle(u’wwwfileinfo’)
)
self.add_media_field(‘license’, field)
More like the latter, but if you want to use a non-“TXXX” field for ID3, you’ll need a different StorageStyle. To make this work, I think you might want to spend a little while working with the MediaFile source code to understand what the options are.
I’m kind of mis-using the WOAF field here (WXXX fields are text fields which are only supposed to contain URL’s, which I hadn’t realized until I dug into the Puddle Tag docs while researching this), but mutagen (and other tools) don’t choke on this misuse as they don’t appear to do any URL validation.
I will dig into the MediaFile source code – but given my surface level understanding of python it’s going to be an uphill struggle for me.