Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
    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)
Beispiel #6
0
    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)
Beispiel #7
0
 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
Beispiel #8
0
 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
Beispiel #9
0
 def get_keys_disk(self):
     keys = CaseInsensitveBaseFormat.get_keys_disk(self)
     if self.mutagen.pictures:
         keys.append('cover')
     return keys
Beispiel #10
0
 def get_keys_disk(self):
     keys = CaseInsensitveBaseFormat.get_keys_disk(self)
     if self.mutagen.pictures:
         keys.append('cover')
     return keys