Skip to content

Commit accb092

Browse files
authored
Merge pull request #325 from tijder/master
Function updated section all with sort
2 parents 99003a1 + abac917 commit accb092

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

plexapi/library.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,17 @@ def get(self, title):
377377
key = '/library/sections/%s/all' % self.key
378378
return self.fetchItem(key, title__iexact=title)
379379

380-
def all(self, **kwargs):
381-
""" Returns a list of media from this library section. """
382-
key = '/library/sections/%s/all' % self.key
380+
def all(self, sort=None, **kwargs):
381+
""" Returns a list of media from this library section.
382+
383+
Parameters:
384+
sort (string): The sort string
385+
"""
386+
sortStr = ''
387+
if sort != None:
388+
sortStr = '?sort=' + sort
389+
390+
key = '/library/sections/%s/all%s' % (self.key, sortStr)
383391
return self.fetchItems(key, **kwargs)
384392

385393
def onDeck(self):

0 commit comments

Comments
 (0)