From 65bb149d7d3d3f1bc16170a34fe9155e8463d041 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Mon, 11 Nov 2019 09:32:55 -0500 Subject: [PATCH] add tag class for media --- plexapi/media.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plexapi/media.py b/plexapi/media.py index bf8ca2b9..47764f82 100644 --- a/plexapi/media.py +++ b/plexapi/media.py @@ -419,6 +419,25 @@ class Label(MediaTag): FILTER = 'label' +@utils.registerPlexObject +class Tag(MediaTag): + """ Represents a single tag media tag. + + Attributes: + TAG (str): 'tag' + FILTER (str): 'tag' + """ + TAG = 'Tag' + FILTER = 'tag' + + def _loadData(self, data): + self._data = data + self.id = cast(int, data.attrib.get('id', 0)) + self.filter = data.attrib.get('filter') + self.tag = data.attrib.get('tag') + self.title = self.tag + + @utils.registerPlexObject class Country(MediaTag): """ Represents a single Country media tag.