mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
use fetchItem and fetchItems instead of query
This commit is contained in:
parent
ad2de7c9a6
commit
2da4d2bf68
1 changed files with 2 additions and 8 deletions
|
@ -366,15 +366,9 @@ class PlexServer(PlexObject):
|
||||||
|
|
||||||
def optimizedItems(self):
|
def optimizedItems(self):
|
||||||
""" Returns list of all :class:`~plexapi.media.Optimized` objects connected to server. """
|
""" Returns list of all :class:`~plexapi.media.Optimized` objects connected to server. """
|
||||||
items = []
|
|
||||||
|
|
||||||
backgroundProcessing = self.query('/playlists?type=42')
|
backgroundProcessing = self.fetchItem('/playlists?type=42')
|
||||||
for elem in backgroundProcessing:
|
return self.fetchItems('%s/items' % backgroundProcessing.key, cls=Optimized)
|
||||||
key = elem.attrib.get('key')
|
|
||||||
for elem in self.query(key):
|
|
||||||
items.append(Optimized(server=self, data=elem))
|
|
||||||
|
|
||||||
return items
|
|
||||||
|
|
||||||
def conversions(self):
|
def conversions(self):
|
||||||
""" Returns list of all :class:`~plexapi.media.Conversion` objects connected to server. """
|
""" Returns list of all :class:`~plexapi.media.Conversion` objects connected to server. """
|
||||||
|
|
Loading…
Reference in a new issue