mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 21:08:27 +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 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from plexapi import media, utils, settings
|
from plexapi import media, utils, settings, library
|
||||||
from plexapi.exceptions import BadRequest, NotFound
|
from plexapi.exceptions import BadRequest, NotFound
|
||||||
from plexapi.base import Playable, PlexPartialObject
|
from plexapi.base import Playable, PlexPartialObject
|
||||||
from plexapi.compat import quote_plus, urlencode
|
from plexapi.compat import quote_plus, urlencode
|
||||||
|
@ -445,6 +445,16 @@ class Show(Video):
|
||||||
|
|
||||||
return items
|
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):
|
def seasons(self, **kwargs):
|
||||||
""" Returns a list of :class:`~plexapi.video.Season` objects. """
|
""" Returns a list of :class:`~plexapi.video.Season` objects. """
|
||||||
key = '/library/metadata/%s/children?excludeAllLeaves=1' % self.ratingKey
|
key = '/library/metadata/%s/children?excludeAllLeaves=1' % self.ratingKey
|
||||||
|
|
Loading…
Add table
Reference in a new issue