mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 06:04:15 +00:00
import Conversion and create conversions function
This commit is contained in:
parent
63024025ce
commit
a9f341169f
1 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,7 @@ from plexapi.settings import Settings
|
|||
from plexapi.playlist import Playlist
|
||||
from plexapi.playqueue import PlayQueue
|
||||
from plexapi.utils import cast
|
||||
from plexapi.media import Conversion
|
||||
|
||||
# Need these imports to populate utils.PLEXOBJECTS
|
||||
from plexapi import (audio as _audio, video as _video, # noqa: F401
|
||||
|
@ -363,6 +364,14 @@ class PlexServer(PlexObject):
|
|||
"""
|
||||
return self.fetchItem('/playlists', title=title)
|
||||
|
||||
def conversions(self):
|
||||
""" Returns list of all :class:`~plexapi.media.Conversion` objects connected to server. """
|
||||
items = []
|
||||
for elem in self.query('/playlists/1111/items'):
|
||||
items.append(Conversion(server=self, data=elem))
|
||||
|
||||
return items
|
||||
|
||||
def query(self, key, method=None, headers=None, timeout=None, **kwargs):
|
||||
""" Main method used to handle HTTPS requests to the Plex server. This method helps
|
||||
by encoding the response to utf-8 and parsing the returned XML into and
|
||||
|
|
Loading…
Reference in a new issue