From c5ba18392ec8a4cdb2113bbb605b4e3c20b07bfc Mon Sep 17 00:00:00 2001 From: Rahul Raturi Date: Sun, 14 Aug 2016 23:25:39 +0530 Subject: [PATCH] Don't use count element... ... for purpose of extracting label information. Reason being, `count` element isn't present in `label_info_list` element of search xml. Checking for length of children has same effect as with checking count element. --- picard/mbxml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/picard/mbxml.py b/picard/mbxml.py index 9e43171db..e839857e6 100644 --- a/picard/mbxml.py +++ b/picard/mbxml.py @@ -208,7 +208,7 @@ def artist_credit_to_metadata(node, m, release=False): def label_info_from_node(node): labels = [] catalog_numbers = [] - if node.count != "0": + if len(node.children) != 0: for label_info in node.label_info: if 'label' in label_info.children: label = label_info.label[0].name[0].text @@ -374,7 +374,7 @@ def release_to_metadata(node, m, album=None): m['barcode'] = nodes[0].text elif name == 'relation_list': _relations_to_metadata(nodes, m) - elif name == 'label_info_list' and getattr(nodes[0], 'count', '0') != '0': + elif name == 'label_info_list' and len(nodes[0].children) != 0: m['label'], m['catalognumber'] = label_info_from_node(nodes[0]) elif name == 'text_representation': if 'language' in nodes[0].children: