New API method for guid

This commit is contained in:
croneter 2018-02-23 12:41:18 +01:00
parent 7f20309dc5
commit 861f6213f1

View file

@ -41,7 +41,7 @@ from xbmcvfs import exists
import clientinfo as client
from downloadutils import DownloadUtils as DU
from utils import window, settings, language as lang, try_decode, try_encode, \
unix_date_to_kodi, exists_dir, slugify, dialog
unix_date_to_kodi, exists_dir, slugify, dialog, escape_html
import PlexFunctions as PF
import plexdb_functions as plexdb
import variables as v
@ -365,6 +365,17 @@ class API(object):
genre.append(child.attrib['tag'])
return genre
def guid_html_escaped(self):
"""
Returns the 'guid' attribute, e.g.
'com.plexapp.agents.thetvdb://76648/2/4?lang=en'
as an HTML-escaped string or None
"""
answ = self.item.get('guid')
if answ is not None:
answ = escape_html(answ)
return answ
def provider(self, providername=None):
"""
providername: e.g. 'imdb', 'tvdb'