Skip to content

Commit

Permalink
Clean up GuidTag and Guid
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Dec 15, 2020
1 parent d102ef3 commit 1f2abdd
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions plexapi/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,24 +515,13 @@ 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).
id (id): The guid for external metadata sources (e.g. IMDB, TMDB, TVDB).
"""

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
Expand Down Expand Up @@ -616,7 +605,11 @@ class Genre(MediaTag):

@utils.registerPlexObject
class Guid(GuidTag):
""" Represents a single Guid media tag. """
""" Represents a single Guid media tag.
Attributes:
TAG (str): 'Guid'
"""
TAG = "Guid"


Expand Down

0 comments on commit 1f2abdd

Please sign in to comment.