From a95c83b01cc4e5c567b4101b741f3b415048bdbe Mon Sep 17 00:00:00 2001 From: Hellow Date: Fri, 3 Mar 2023 12:39:43 +0100 Subject: [PATCH] Update collection.py --- src/music_kraken/objects/collection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/music_kraken/objects/collection.py b/src/music_kraken/objects/collection.py index 8ec764a..80deb4d 100644 --- a/src/music_kraken/objects/collection.py +++ b/src/music_kraken/objects/collection.py @@ -66,11 +66,15 @@ class Collection: for source_url in element.source_url_map: if source_url in self._by_url: + if merge_on_conflict: + self._by_url[source_url].merge(element) return for attr in self.map_attributes: value = element.__getattribute__(attr) if value in self._by_attribute[attr]: + if merge_on_conflict: + self._by_attribute[attr][value].merge(element) return self._data.append(element)