Add types_and_front() helper function

- it converts id3 type to CAA-like type list
- it returns a is_front boolean, emulating CAA flag
This commit is contained in:
Laurent Monin
2014-05-05 17:35:09 +02:00
parent 7a1607e8c3
commit 7de9477b7b

View File

@@ -92,6 +92,12 @@ def image_type_as_id3_num(texttype):
return __ID3_IMAGE_TYPE_MAP.get(texttype, 0)
def types_and_front(id3type):
imgtype = image_type_from_id3_num(id3type)
is_front = imgtype == 'front'
return [unicode(imgtype)], is_front
class ID3File(File):
"""Generic ID3-based file."""