Skip to content

Commit 74c9a9a

Browse files
committed
add optimizedItem method
1 parent 390db12 commit 74c9a9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plexapi/server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,14 @@ def optimizedItems(self, removeAll=None):
382382
backgroundProcessing = self.fetchItem('/playlists?type=42')
383383
return self.fetchItems('%s/items' % backgroundProcessing.key, cls=Optimized)
384384

385+
def optimizedItem(self, optimizedID):
386+
""" Returns single queued optimized item :class:`~plexapi.media.Video` object.
387+
Allows for using optimized item ID to connect back to source item.
388+
"""
389+
390+
backgroundProcessing = self.fetchItem('/playlists?type=42')
391+
return self.fetchItem('%s/items/%s/items' % (backgroundProcessing.key, optimizedID))
392+
385393
def conversions(self, pause=None):
386394
""" Returns list of all :class:`~plexapi.media.Conversion` objects connected to server. """
387395
if pause is True:

0 commit comments

Comments
 (0)