def __init__(self, *args, **kwargs): album_sort_field = mediafile.MediaField( mediafile.MP3StorageStyle(u"TSOA"), mediafile.MP4StorageStyle(u"soal"), mediafile.StorageStyle(u"Album Sort") ) self.add_media_field("album_sort", album_sort_field) self.register_listener("write", self.write) super().__init__(*args, **kwargs)
def setUp(self): self.create_temp_dir() self.key = "READ_ONLY_TEST" self.field = mediafile.MediaField( mediafile.MP3StorageStyle(self.key, read_only=True), mediafile.MP4StorageStyle("----:com.apple.iTunes:" + self.key, read_only=True), mediafile.StorageStyle(self.key, read_only=True), mediafile.ASFStorageStyle(self.key, read_only=True), ) if "read_only_test" not in mediafile.MediaFile.fields(): mediafile.MediaFile.add_field("read_only_test", self.field)