Skip to content

Commit a9f3411

Browse files
committed
import Conversion and create conversions function
1 parent 6302402 commit a9f3411

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plexapi/server.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from plexapi.playlist import Playlist
1414
from plexapi.playqueue import PlayQueue
1515
from plexapi.utils import cast
16+
from plexapi.media import Conversion
1617

1718
# Need these imports to populate utils.PLEXOBJECTS
1819
from plexapi import (audio as _audio, video as _video, # noqa: F401
@@ -363,6 +364,14 @@ def playlist(self, title):
363364
"""
364365
return self.fetchItem('/playlists', title=title)
365366

367+
def conversions(self):
368+
""" Returns list of all :class:`~plexapi.media.Conversion` objects connected to server. """
369+
items = []
370+
for elem in self.query('/playlists/1111/items'):
371+
items.append(Conversion(server=self, data=elem))
372+
373+
return items
374+
366375
def query(self, key, method=None, headers=None, timeout=None, **kwargs):
367376
""" Main method used to handle HTTPS requests to the Plex server. This method helps
368377
by encoding the response to utf-8 and parsing the returned XML into and

0 commit comments

Comments
 (0)