From 5831c8ff1b2f4bdbdfbc2a5f01de4fc09694453a Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 23 Jan 2022 18:05:29 +0100 Subject: [PATCH] mbjson: Make use of m.add_unique --- picard/mbjson.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/picard/mbjson.py b/picard/mbjson.py index 7a5cb27a7..4a0bf23b1 100644 --- a/picard/mbjson.py +++ b/picard/mbjson.py @@ -172,10 +172,9 @@ def _relations_to_metadata(relations, m, instrumental=False): continue if instrumental and name == 'lyricist': continue - if value not in m[name]: - m.add(name, value) - if name == 'composer' and valuesort not in m['composersort']: - m.add('composersort', valuesort) + m.add_unique(name, value) + if name == 'composer': + m.add_unique('composersort', valuesort) elif relation['target-type'] == 'work': if relation['type'] == 'performance': performance_attributes = get_relation_attributes(relation)