def _set_tag(self, raw, tag, value): if tag == 'metadata_block_picture': new_value = [] for v in value: picture = Picture() picture.type = v.type picture.desc = v.desc picture.mime = v.mime picture.data = v.data new_value.append(base64.b64encode(picture.write())) value = new_value else: # vorbis has text based attributes, so convert everything to unicode value = [xl.unicode.to_unicode(v) for v in value] CaseInsensitveBaseFormat._set_tag(self, raw, tag, value)
def _set_tag(self, raw, tag, value): if tag == 'metadata_block_picture': new_value = [] for v in value: picture = Picture() picture.type = v.type picture.desc = v.desc picture.mime = v.mime picture.data = v.data new_value.append(base64.b64encode(picture.write())) value = new_value else: # vorbis has text based attributes, so convert everything to unicode value = [xl.unicode.to_unicode(v) for v in value] CaseInsensitveBaseFormat._set_tag(self, raw, tag, value)
def _set_tag(self, raw, tag, value): if tag == '__cover': raw.clear_pictures() for v in value: picture = Picture() picture.type = v.type picture.desc = v.desc picture.mime = v.mime picture.data = v.data raw.add_picture(picture) return # flac has text based attributes, so convert everything to unicode value = [xl.unicode.to_unicode(v) for v in value] CaseInsensitveBaseFormat._set_tag(self, raw, tag, value)
def _set_tag(self, raw, tag, value): if tag == '__cover': raw.clear_pictures() for v in value: picture = Picture() picture.type = v.type picture.desc = v.desc picture.mime = v.mime picture.data = v.data raw.add_picture(picture) return # flac has text based attributes, so convert everything to unicode value = [xl.unicode.to_unicode(v) for v in value] CaseInsensitveBaseFormat._set_tag(self, raw, tag, value)
def _get_tag(self, raw, tag): if tag == '__cover': return [ CoverImage(type=p.type, desc=p.desc, mime=p.mime, data=p.data) for p in raw.pictures ] return CaseInsensitveBaseFormat._get_tag(self, raw, tag)
def _get_tag(self, raw, tag): if tag == '__cover': return [ CoverImage(type=p.type, desc=p.desc, mime=p.mime, data=p.data) for p in raw.pictures ] return CaseInsensitveBaseFormat._get_tag(self, raw, tag)
def _get_tag(self, raw, tag): value = CaseInsensitveBaseFormat._get_tag(self, raw, tag) if value and tag == 'metadata_block_picture': new_value = [] for v in value: picture = Picture(base64.b64decode(v)) new_value.append(CoverImage(type=picture.type, desc=picture.desc, mime=picture.mime, data=picture.data)) value = new_value return value
def _get_tag(self, raw, tag): value = CaseInsensitveBaseFormat._get_tag(self, raw, tag) if value and tag == 'metadata_block_picture': new_value = [] for v in value: picture = Picture(base64.b64decode(v)) new_value.append( CoverImage( type=picture.type, desc=picture.desc, mime=picture.mime, data=picture.data, ) ) value = new_value return value
def get_keys_disk(self): keys = CaseInsensitveBaseFormat.get_keys_disk(self) if self.mutagen.pictures: keys.append('cover') return keys
def get_keys_disk(self): keys = CaseInsensitveBaseFormat.get_keys_disk(self) if self.mutagen.pictures: keys.append('cover') return keys