alter the way the info mode is handled to not need a db rebuild -

currently only working from home widgets
This commit is contained in:
im85288 2015-05-07 16:05:04 +01:00
parent 24c4d267c4
commit 5ac32f467a
4 changed files with 18 additions and 22 deletions

View file

@ -28,11 +28,17 @@ except:
##### Play items via plugin://plugin.video.emby/ ##### ##### Play items via plugin://plugin.video.emby/ #####
if mode == "play": if mode == "play":
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
selectAction = addonSettings.getSetting('selectAction')
##### info only working from widgets currently #####
if selectAction == "1" and xbmc.getCondVisibility("Window.IsActive(home)"):
entrypoint.showInfo(id)
else:
entrypoint.doPlayback(id)
elif mode == "playnow":
entrypoint.doPlayback(id) entrypoint.doPlayback(id)
elif mode == "info":
entrypoint.showInfo(id)
elif mode == "person": elif mode == "person":
entrypoint.showPersonInfo(id,name) entrypoint.showPersonInfo(id,name)

View file

@ -124,7 +124,7 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
self.isTrailer = True self.isTrailer = True
self.playUrl = "plugin://plugin.video.emby/?id=%s&mode=play" % id self.playUrl = "plugin://plugin.video.emby/?id=%s&mode=playnow" % id
try: try:
trailerButton = self.getControl(3102) trailerButton = self.getControl(3102)
@ -134,7 +134,7 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
jsonData = self.downloadUtils.downloadUrl(itemTrailerUrl) jsonData = self.downloadUtils.downloadUrl(itemTrailerUrl)
if(jsonData != ""): if(jsonData != ""):
trailerItem = jsonData trailerItem = jsonData
self.trailerUrl = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % trailerItem[0][u'Id'] self.trailerUrl = "plugin://plugin.video.emby/trailer/?id=%s&mode=playnow" % trailerItem[0][u'Id']
else: else:
trailerButton.setEnabled(False) trailerButton.setEnabled(False)
except: except:
@ -406,10 +406,11 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
seriesimage = API().getArtwork(item, "SeriesPrimary") seriesimage = API().getArtwork(item, "SeriesPrimary")
try: try:
self.getControl(3099).setImage(seriesimage) self.getControl(3099).setImage(seriesimage)
self.getControl(3009).setImage(image)
except: except:
pass pass
self.getControl(3009).setImage(image)
if(cappedPercentage != None): if(cappedPercentage != None):
self.getControl(3010).setImage("Progress\progress_" + str(cappedPercentage) + ".png") self.getControl(3010).setImage("Progress\progress_" + str(cappedPercentage) + ".png")
else: else:

View file

@ -114,7 +114,7 @@ class PersonInfo(xbmcgui.WindowXMLDialog):
listItem = xbmcgui.ListItem(label=item_name, label2=type_info, iconImage=thumbPath, thumbnailImage=thumbPath) listItem = xbmcgui.ListItem(label=item_name, label2=type_info, iconImage=thumbPath, thumbnailImage=thumbPath)
listItem.setArt({"fanart":fanArt}) listItem.setArt({"fanart":fanArt})
actionUrl = "plugin://plugin.video.emby?id=" + item_id + "&mode=info" actionUrl = "plugin://plugin.video.emby?id=" + item_id + "&mode=play"
listItem.setProperty("ActionUrl", actionUrl) listItem.setProperty("ActionUrl", actionUrl)
otherItemsList.addItem(listItem) otherItemsList.addItem(listItem)

View file

@ -106,7 +106,7 @@ class WriteKodiVideoDB():
jsonData = downloadUtils.downloadUrl(itemTrailerUrl) jsonData = downloadUtils.downloadUrl(itemTrailerUrl)
if(jsonData != ""): if(jsonData != ""):
trailerItem = jsonData trailerItem = jsonData
trailerUrl = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % trailerItem[0][u'Id'] trailerUrl = "plugin://plugin.video.emby/trailer/?id=%s&mode=playnow" % trailerItem[0][u'Id']
if MBitem.get("DateCreated") != None: if MBitem.get("DateCreated") != None:
dateadded = MBitem["DateCreated"].split('.')[0].replace('T', " ") dateadded = MBitem["DateCreated"].split('.')[0].replace('T', " ")
@ -122,12 +122,7 @@ class WriteKodiVideoDB():
#### ADD OR UPDATE THE FILE AND PATH ########### #### ADD OR UPDATE THE FILE AND PATH ###########
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
path = "plugin://plugin.video.emby/movies/%s/" % MBitem["Id"] path = "plugin://plugin.video.emby/movies/%s/" % MBitem["Id"]
addonSettings = xbmcaddon.Addon(id='plugin.video.emby') filename = "plugin://plugin.video.emby/movies/%s/?id=%s&mode=play" % (MBitem["Id"],MBitem["Id"])
selectAction = addonSettings.getSetting('selectAction')
if(selectAction == "1"):
filename = "plugin://plugin.video.emby/movies/%s/?id=%s&mode=info" % (MBitem["Id"],MBitem["Id"])
else:
filename = "plugin://plugin.video.emby/movies/%s/?id=%s&mode=play" % (MBitem["Id"],MBitem["Id"])
#create the path #create the path
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,)) cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
@ -548,13 +543,7 @@ class WriteKodiVideoDB():
#### ADD OR UPDATE THE FILE AND PATH ########### #### ADD OR UPDATE THE FILE AND PATH ###########
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
path = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/" path = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/"
addonSettings = xbmcaddon.Addon(id='plugin.video.emby') filename = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/?id=" + MBitem["Id"] + "&mode=play"
selectAction = addonSettings.getSetting('selectAction')
if(selectAction == "1"):
filename = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/?id=" + MBitem["Id"] + "&mode=info"
else:
filename = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/?id=" + MBitem["Id"] + "&mode=play"
#create the new path - return id if already exists #create the new path - return id if already exists
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,)) cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))