@@ -0,0 +1,1188 @@
+from beets.plugins import BeetsPlugin%0Afrom beets import mediafile%0A%0Aimport os, logging%0A%0Afrom email.mime.image import MIMEImage%0A%0Alog = logging.getLogger('beets')%0Alog.addHandler(logging.StreamHandler())%0A%0A%0Aclass EmbedAlbumartPlugin(BeetsPlugin):%0A    '''Allows albumart to be embedded into the actual files'''%0A%0A    def __init__(self):%0A        self.register_listener('loaded', self.loaded)%0A        self.register_listener('album_imported', self.album_imported)%0A%0A    def configure(self, config):%0A        pass%0A%0A    def loaded(self):%0A        pass%0A%0A    def album_imported(self, album):%0A        albumart = album.artpath%0A        ALLOWED_MIMES = ('jpeg','png')%0A%0A        if albumart:%0A            albumart_raw = open(albumart, 'rb').read()%0A            img = MIMEImage(albumart_raw)%0A            mime_img = img.get_content_subtype()%0A%0A            if mime_img in ALLOWED_MIMES:%0A                mime_type = 'image/%25s' %25 mime_img%0A%0A            for item in album.items():%0A                f = mediafile.MediaFile(item)%0A                %0A                if %22mp3%22 in item.type:%0A                    f.albumart_mime = mime_type%0A                %0A                f.albumart_data = albumart_raw%0A                f.save()%0A%0A

Add initial version of the embed coverart plugin.