From 7de9477b7b58cd8c30ea032cb346c0f0010dda4c Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Mon, 5 May 2014 17:35:09 +0200 Subject: [PATCH] Add types_and_front() helper function - it converts id3 type to CAA-like type list - it returns a is_front boolean, emulating CAA flag --- picard/formats/id3.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/picard/formats/id3.py b/picard/formats/id3.py index 5afb0738f..94c05f2f7 100644 --- a/picard/formats/id3.py +++ b/picard/formats/id3.py @@ -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."""