Fix Episode Info not popping up

This commit is contained in:
tomkat83 2016-04-20 08:46:51 +02:00
parent f1015ab847
commit 34c40f1f28
2 changed files with 14 additions and 9 deletions

View file

@ -1301,9 +1301,9 @@ class TVShows(Items):
# GET THE FILE AND PATH ##### # GET THE FILE AND PATH #####
doIndirect = not self.directpath doIndirect = not self.directpath
playurl = API.getFilePath()
if self.directpath: if self.directpath:
# Direct paths is set the Kodi way # Direct paths is set the Kodi way
playurl = API.getFilePath()
if playurl is None: if playurl is None:
# Something went wrong, trying to use non-direct paths # Something went wrong, trying to use non-direct paths
doIndirect = True doIndirect = True
@ -1320,9 +1320,16 @@ class TVShows(Items):
path = playurl.replace(filename, "") path = playurl.replace(filename, "")
if doIndirect: if doIndirect:
# Set plugin path and media flags using real filename # Set plugin path and media flags using real filename
path = "plugin://plugin.video.plexkodiconnect.tvshows/" if playurl is not None:
if '\\' in playurl:
filename = playurl.rsplit('\\', 1)[1]
else:
filename = playurl.rsplit('/', 1)[1]
else:
filename = 'file_not_found'
path = "plugin://plugin.video.plexkodiconnect.tvshows/%s/" % seriesId
params = { params = {
'filename': API.getKey().encode('utf-8'), 'filename': filename.encode('utf-8'),
'id': itemid, 'id': itemid,
'dbid': episodeid, 'dbid': episodeid,
'mode': "play" 'mode': "play"

View file

@ -56,17 +56,15 @@ class Kodidb_Functions():
For some reason, Kodi ignores this if done via itemtypes while e.g. For some reason, Kodi ignores this if done via itemtypes while e.g.
adding or updating items. (addPath method does NOT work) adding or updating items. (addPath method does NOT work)
""" """
types = ['movies', 'tvshows']
query = ' '.join(( query = ' '.join((
"UPDATE path", "UPDATE path",
"SET strContent = ?, strScraper = ?", "SET strContent = ?, strScraper = ?",
"WHERE strPath LIKE ?" "WHERE strPath LIKE ?"
)) ))
for typus in types: self.cursor.execute(
self.cursor.execute( query, ('movies',
query, (typus, 'metadata.local',
'metadata.local', 'plugin://plugin.video.plexkodiconnect.movies%%'))
'plugin://plugin.video.plexkodiconnect.%s%%' % typus))
def addPath(self, path, strHash=None): def addPath(self, path, strHash=None):
# SQL won't return existing paths otherwise # SQL won't return existing paths otherwise