Added "library.root" event, fixes to "matcher", "release" and "score" to use "library.root" + handle missing "year"
This commit is contained in:
1 parent
4efdca91d5
commit
050d8ccfda
5 files changed
+16
-6
No files matched your search
@@ -11,6 +11,7 @@ class Library(LibraryBase):
|
||||
def __init__(self):
|
||||
addEvent('library.title', self.title)
|
||||
addEvent('library.related', self.related)
|
||||
addEvent('library.root', self.root)
|
||||
|
||||
addApiView('library.query', self.queryView)
|
||||
addApiView('library.related', self.relatedView)
|
||||
@@ -54,3 +55,12 @@ class Library(LibraryBase):
|
||||
result[cur['type']] = cur
|
||||
|
||||
return result
|
||||
|
||||
def root(self, media):
|
||||
db = get_db()
|
||||
cur = media
|
||||
|
||||
while cur and cur.get('parent_id'):
|
||||
cur = db.get('id', cur['parent_id'])
|
||||
|
||||
return cur
|
||||
Reference in new issue
Block a user