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:
parent
24c4d267c4
commit
5ac32f467a
4 changed files with 18 additions and 22 deletions
10
default.py
10
default.py
|
@ -28,10 +28,16 @@ except:
|
|||
|
||||
##### Play items via plugin://plugin.video.emby/ #####
|
||||
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 == "info":
|
||||
entrypoint.showInfo(id)
|
||||
elif mode == "playnow":
|
||||
entrypoint.doPlayback(id)
|
||||
|
||||
elif mode == "person":
|
||||
entrypoint.showPersonInfo(id,name)
|
||||
|
|
|
@ -124,7 +124,7 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
|
|||
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:
|
||||
trailerButton = self.getControl(3102)
|
||||
|
@ -134,7 +134,7 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
|
|||
jsonData = self.downloadUtils.downloadUrl(itemTrailerUrl)
|
||||
if(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:
|
||||
trailerButton.setEnabled(False)
|
||||
except:
|
||||
|
@ -406,10 +406,11 @@ class ItemInfo(xbmcgui.WindowXMLDialog):
|
|||
seriesimage = API().getArtwork(item, "SeriesPrimary")
|
||||
try:
|
||||
self.getControl(3099).setImage(seriesimage)
|
||||
self.getControl(3009).setImage(image)
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
self.getControl(3009).setImage(image)
|
||||
if(cappedPercentage != None):
|
||||
self.getControl(3010).setImage("Progress\progress_" + str(cappedPercentage) + ".png")
|
||||
else:
|
||||
|
|
|
@ -114,7 +114,7 @@ class PersonInfo(xbmcgui.WindowXMLDialog):
|
|||
listItem = xbmcgui.ListItem(label=item_name, label2=type_info, iconImage=thumbPath, thumbnailImage=thumbPath)
|
||||
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)
|
||||
|
||||
otherItemsList.addItem(listItem)
|
||||
|
|
|
@ -106,7 +106,7 @@ class WriteKodiVideoDB():
|
|||
jsonData = downloadUtils.downloadUrl(itemTrailerUrl)
|
||||
if(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:
|
||||
dateadded = MBitem["DateCreated"].split('.')[0].replace('T', " ")
|
||||
|
@ -122,11 +122,6 @@ class WriteKodiVideoDB():
|
|||
#### ADD OR UPDATE THE FILE AND PATH ###########
|
||||
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
|
||||
path = "plugin://plugin.video.emby/movies/%s/" % MBitem["Id"]
|
||||
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
||||
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
|
||||
|
@ -548,14 +543,8 @@ class WriteKodiVideoDB():
|
|||
#### ADD OR UPDATE THE FILE AND PATH ###########
|
||||
#### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY
|
||||
path = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/"
|
||||
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
||||
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
|
||||
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?",(path,))
|
||||
result = cursor.fetchone()
|
||||
|
|
Loading…
Reference in a new issue