diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index bd704f5c..19e97541 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -110,7 +110,7 @@ def fireEvent(name, *args, **kwargs): if isinstance(results[0], dict): merged = {} for result in results: - merged = mergeDicts(merged, result) + merged = mergeDicts(merged, result, prepend_list = True) results = merged # Lists diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py index 82bf88f7..ff1043bb 100644 --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -53,7 +53,7 @@ def getDataDir(): def isDict(object): return isinstance(object, dict) -def mergeDicts(a, b): +def mergeDicts(a, b, prepend_list = False): assert isDict(a), isDict(b) dst = a.copy() @@ -67,7 +67,7 @@ def mergeDicts(a, b): if isDict(current_src[key]) and isDict(current_dst[key]): stack.append((current_dst[key], current_src[key])) elif isinstance(current_src[key], list) and isinstance(current_dst[key], list): - current_dst[key].extend(current_src[key]) + current_dst[key] = current_src[key] + current_dst[key] if prepend_list else current_dst[key] + current_src[key] current_dst[key] = removeListDuplicates(current_dst[key]) else: current_dst[key] = current_src[key]