Speed up Library Get

The original code pull a full list of all library items and then searched that list.
With this change, the library get uses the title as a search filter such that the returned list is much shorter.
This commit is contained in:
zSeriesGuy 2019-11-18 15:36:17 -05:00
parent 97903cf189
commit 442c55a03a

View file

@ -374,7 +374,7 @@ class LibrarySection(PlexObject):
Parameters:
title (str): Title of the item to return.
"""
key = '/library/sections/%s/all' % self.key
key = '/library/sections/%s/all?title=%s' % (self.key, title)
return self.fetchItem(key, title__iexact=title)
def all(self, sort=None, **kwargs):