From b3c2945d9bfb38cf70560c6b7f9e39b113580574 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Wed, 18 Dec 2013 20:38:14 +1300 Subject: [PATCH] 'related_libraries' and 'root_library' references are now added to child libraries. --- couchpotato/core/settings/model.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/couchpotato/core/settings/model.py b/couchpotato/core/settings/model.py index db9b5400..21f8be49 100644 --- a/couchpotato/core/settings/model.py +++ b/couchpotato/core/settings/model.py @@ -184,6 +184,15 @@ class Library(Entity): root_library = related_libraries.get(root_key) orig_dict['root_library'] = root_library[0] if root_library else None + # Add references to children + for key, libraries in related_libraries.items(): + for library in libraries: + # Add related_libraries + library['related_libraries'] = orig_dict['related_libraries'] + + # Add root_library + library['root_library'] = orig_dict['root_library'] + return orig_dict