Skip to content

Commit 442c55a

Browse files
committed
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.
1 parent 97903cf commit 442c55a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plexapi/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def get(self, title):
374374
Parameters:
375375
title (str): Title of the item to return.
376376
"""
377-
key = '/library/sections/%s/all' % self.key
377+
key = '/library/sections/%s/all?title=%s' % (self.key, title)
378378
return self.fetchItem(key, title__iexact=title)
379379

380380
def all(self, sort=None, **kwargs):

0 commit comments

Comments
 (0)