From d75f58f5ecb5042e58ac6cd59af3877ea2be9c34 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Sat, 26 Jul 2014 22:29:16 +1200 Subject: [PATCH] Fixed "library.related" and "libary.tree" to work with "show.episode", 'show.season" media types --- couchpotato/core/media/_base/library/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/media/_base/library/main.py b/couchpotato/core/media/_base/library/main.py index c0e4464b..b565d16e 100755 --- a/couchpotato/core/media/_base/library/main.py +++ b/couchpotato/core/media/_base/library/main.py @@ -63,7 +63,9 @@ class Library(LibraryBase): while cur and cur.get('parent_id'): cur = db.get('id', cur['parent_id']) - result[cur['type']] = cur + parts = cur['type'].split('.') + + result[parts[-1]] = cur return result @@ -85,7 +87,8 @@ class Library(LibraryBase): keys = [] for item in items: - key = item['doc']['type'] + 's' + parts = item['doc']['type'].split('.') + key = parts[-1] + 's' if key not in result: result[key] = {}