mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 11:43:13 +00:00
import library and create hubs method
This commit is contained in:
parent
6a69fe4810
commit
81339cc3dc
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from plexapi import media, utils, settings
|
||||
from plexapi import media, utils, settings, library
|
||||
from plexapi.exceptions import BadRequest, NotFound
|
||||
from plexapi.base import Playable, PlexPartialObject
|
||||
from plexapi.compat import quote_plus, urlencode
|
||||
|
@ -445,6 +445,16 @@ class Show(Video):
|
|||
|
||||
return items
|
||||
|
||||
def hubs(self):
|
||||
""" Returns a list of :class:`~plexapi.library.Hub` objects. """
|
||||
items = []
|
||||
data = self._server.query(self._details_key)
|
||||
for item in data.iter('Related'):
|
||||
for elem in item:
|
||||
items.append(library.Hub(data=elem, server=self._server))
|
||||
|
||||
return items
|
||||
|
||||
def seasons(self, **kwargs):
|
||||
""" Returns a list of :class:`~plexapi.video.Season` objects. """
|
||||
key = '/library/metadata/%s/children?excludeAllLeaves=1' % self.ratingKey
|
||||
|
|
Loading…
Reference in a new issue