mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Add Guid tags to plexapi.video.Movie
This commit is contained in:
parent
28e2463c4f
commit
c7621a9e36
2 changed files with 31 additions and 0 deletions
|
@ -586,6 +586,29 @@ class MediaTag(PlexObject):
|
||||||
return self.fetchItems(self.key)
|
return self.fetchItems(self.key)
|
||||||
|
|
||||||
|
|
||||||
|
class GuidTag(PlexObject):
|
||||||
|
""" Base class for guid tags used only for Guids, as they contain only a string identifier
|
||||||
|
Attributes:
|
||||||
|
server (:class:`~plexapi.server.PlexServer`): Server this client is connected to.
|
||||||
|
id (id): Tag ID (Used as a unique id, except for Guid's, used for external systems
|
||||||
|
to plex identifiers, like imdb and tmdb).
|
||||||
|
"""
|
||||||
|
|
||||||
|
def _loadData(self, data):
|
||||||
|
""" Load attribute values from Plex XML response. """
|
||||||
|
self._data = data
|
||||||
|
self.id = data.attrib.get('id')
|
||||||
|
self.tag = data.attrib.get('tag')
|
||||||
|
|
||||||
|
def items(self, *args, **kwargs):
|
||||||
|
""" Return the list of items within this tag. This function is only applicable
|
||||||
|
in search results from PlexServer :func:`~plexapi.server.PlexServer.search()`.
|
||||||
|
"""
|
||||||
|
if not self.key:
|
||||||
|
raise BadRequest('Key is not defined for this tag: %s' % self.tag)
|
||||||
|
return self.fetchItems(self.key)
|
||||||
|
|
||||||
|
|
||||||
@utils.registerPlexObject
|
@utils.registerPlexObject
|
||||||
class Collection(MediaTag):
|
class Collection(MediaTag):
|
||||||
""" Represents a single Collection media tag.
|
""" Represents a single Collection media tag.
|
||||||
|
@ -665,6 +688,12 @@ class Genre(MediaTag):
|
||||||
FILTER = 'genre'
|
FILTER = 'genre'
|
||||||
|
|
||||||
|
|
||||||
|
@utils.registerPlexObject
|
||||||
|
class Guid(GuidTag):
|
||||||
|
""" Represents a single Guid media tag. """
|
||||||
|
TAG = "Guid"
|
||||||
|
|
||||||
|
|
||||||
@utils.registerPlexObject
|
@utils.registerPlexObject
|
||||||
class Mood(MediaTag):
|
class Mood(MediaTag):
|
||||||
""" Represents a single Mood media tag.
|
""" Represents a single Mood media tag.
|
||||||
|
|
|
@ -266,6 +266,7 @@ class Movie(Playable, Video):
|
||||||
directors (List<:class:`~plexapi.media.Director`>): List of director objects.
|
directors (List<:class:`~plexapi.media.Director`>): List of director objects.
|
||||||
fields (List<:class:`~plexapi.media.Field`>): List of field objects.
|
fields (List<:class:`~plexapi.media.Field`>): List of field objects.
|
||||||
genres (List<:class:`~plexapi.media.Genre`>): List of genre objects.
|
genres (List<:class:`~plexapi.media.Genre`>): List of genre objects.
|
||||||
|
guids (List<:class:`~plexapi.media.Guid`>): List of guid objects.
|
||||||
media (List<:class:`~plexapi.media.Media`>): List of media objects.
|
media (List<:class:`~plexapi.media.Media`>): List of media objects.
|
||||||
producers (List<:class:`~plexapi.media.Producer`>): List of producers objects.
|
producers (List<:class:`~plexapi.media.Producer`>): List of producers objects.
|
||||||
roles (List<:class:`~plexapi.media.Role`>): List of role objects.
|
roles (List<:class:`~plexapi.media.Role`>): List of role objects.
|
||||||
|
@ -310,6 +311,7 @@ class Movie(Playable, Video):
|
||||||
self.directors = self.findItems(data, media.Director)
|
self.directors = self.findItems(data, media.Director)
|
||||||
self.fields = self.findItems(data, media.Field)
|
self.fields = self.findItems(data, media.Field)
|
||||||
self.genres = self.findItems(data, media.Genre)
|
self.genres = self.findItems(data, media.Genre)
|
||||||
|
self.guids = self.findItems(data, media.Guid)
|
||||||
self.media = self.findItems(data, media.Media)
|
self.media = self.findItems(data, media.Media)
|
||||||
self.producers = self.findItems(data, media.Producer)
|
self.producers = self.findItems(data, media.Producer)
|
||||||
self.roles = self.findItems(data, media.Role)
|
self.roles = self.findItems(data, media.Role)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue