You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/plex/objects/agent.py

30 lines
722 B

from plex.objects.core.base import Descriptor, Property
class MediaType(Descriptor):
name = Property
media_type = Property("mediaType", type=int)
@classmethod
def from_node(cls, client, node):
items = []
for t in cls.helpers.findall(node, 'MediaType'):
_, obj = MediaType.construct(client, t, child=True)
items.append(obj)
return [], items
class Agent(Descriptor):
name = Property
enabled = Property(type=int)
identifier = Property
primary = Property(type=int)
has_prefs = Property("hasPrefs", type=int)
has_attribution = Property("hasAttribution", type=int)
media_types = Property(resolver=lambda: MediaType.from_node)