Skip to content

Commit

Permalink
Recently added is missing from LibrarySection #58
Browse files Browse the repository at this point in the history
  • Loading branch information
pkkid committed May 24, 2016
1 parent 0c8587c commit 3d28b53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def all(self):

def onDeck(self):
return utils.listItems(self.server, '/library/sections/%s/onDeck' % self.key)

def recentlyAdded(self, maxresults=50):
return self.search(sort='addedAt:desc', maxresults=maxresults)

def analyze(self):
self.server.query('/library/sections/%s/analyze' % self.key)
Expand Down Expand Up @@ -224,7 +227,7 @@ def _cleanSearchFilter(self, category, value, libtype=None):
if matches: map(result.add, matches); continue
# nothing matched; use raw item value
log.warning('Filter value not listed, using raw item value: %s' % item)
result.add(item)
result.add(item)
return ','.join(result)

def _cleanSearchSort(self, sort):
Expand Down Expand Up @@ -257,6 +260,9 @@ def searchShows(self, **kwargs):
def searchEpisodes(self, **kwargs):
return self.search(libtype='episode', **kwargs)

def recentlyAdded(self, libtype='episode', maxresults=50):
return self.search(sort='addedAt:desc', libtype=libtype, maxresults=maxresults)


class MusicSection(LibrarySection):
ALLOWED_FILTERS = ('genre', 'country', 'collection')
Expand Down

0 comments on commit 3d28b53

Please sign in to comment.