mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 21:08:27 +00:00
Adding collection sorting
collectionSort to data and sortUpdate function.
This commit is contained in:
parent
9149d999e0
commit
02026cc65b
1 changed files with 7 additions and 0 deletions
|
@ -995,6 +995,7 @@ class Collections(PlexObject):
|
|||
self.minYear = utils.cast(int, data.attrib.get('minYear'))
|
||||
self.maxYear = utils.cast(int, data.attrib.get('maxYear'))
|
||||
self.collectionMode = data.attrib.get('collectionMode')
|
||||
self.collectionSort = data.attrib.get('collectionSort')
|
||||
|
||||
@property
|
||||
def children(self):
|
||||
|
@ -1015,5 +1016,11 @@ class Collections(PlexObject):
|
|||
part = '/library/metadata/%s/prefs?collectionMode=%s' % (self.ratingKey, mode_dict[mode])
|
||||
return self._server.query(part, method=self._server._session.put)
|
||||
|
||||
def sortUpdate(self, sort=['release', 'alpha']):
|
||||
sort_dict = {'release': '0',
|
||||
'alpha': '1'}
|
||||
part = '/library/metadata/%s/prefs?collectionSort=%s' % (self.ratingKey, sort_dict[sort])
|
||||
return self._server.query(part, method=self._server._session.put)
|
||||
|
||||
# def edit(self, **kwargs):
|
||||
# TODO
|
||||
|
|
Loading…
Add table
Reference in a new issue