some more fixes

This commit is contained in:
Marcel van der Veldt 2015-05-01 18:32:13 +02:00
parent a8235061e1
commit e77d5c7c53
3 changed files with 19 additions and 10 deletions

View file

@ -27,7 +27,8 @@ except:
id=None id=None
if mode != None and mode == "play": if mode != None and mode == "play":
PlaybackUtils().PLAY(id) #PlaybackUtils().PLAY(id)
WINDOW.setProperty('GUIPLAY', str(id)) # set window prop
elif sys.argv[1] == "reset": elif sys.argv[1] == "reset":
utils.reset() utils.reset()
else: else:

View file

@ -43,7 +43,6 @@ class WriteKodiDB():
else: else:
downloadUtils.downloadUrl(watchedurl, type="DELETE") downloadUtils.downloadUrl(watchedurl, type="DELETE")
def addOrUpdateMovieToKodiLibrary( self, embyId ,connection, cursor, viewTag): def addOrUpdateMovieToKodiLibrary( self, embyId ,connection, cursor, viewTag):
addon = xbmcaddon.Addon(id='plugin.video.emby') addon = xbmcaddon.Addon(id='plugin.video.emby')
@ -100,7 +99,7 @@ class WriteKodiDB():
jsonData = downloadUtils.downloadUrl(itemTrailerUrl) jsonData = downloadUtils.downloadUrl(itemTrailerUrl)
if(jsonData != ""): if(jsonData != ""):
trailerItem = jsonData trailerItem = jsonData
trailerUrl = "plugin://plugin.video.emby/mode=play?id=" + trailerItem[0][u'Id'] trailerUrl = "plugin://plugin.video.emby/?id=%s&mode=play" % trailerItem[0][u'Id']
if MBitem.get("DateCreated") != None: if MBitem.get("DateCreated") != None:
dateadded = MBitem["DateCreated"].replace("T"," ") dateadded = MBitem["DateCreated"].replace("T"," ")
@ -644,11 +643,13 @@ class WriteKodiDB():
# Kodi Gotham or Helix database # # Kodi Gotham or Helix database #
if mediatype == "movie": if mediatype == "movie":
peoplesql="INSERT OR REPLACE into actorlinkmovie(idActor, idMovie, strRole, iOrder) values(?, ?, ?, ?)" peoplesql="INSERT OR REPLACE into actorlinkmovie(idActor, idMovie, strRole, iOrder) values(?, ?, ?, ?)"
cursor.execute(peoplesql, (actorid,id,Role,None))
if mediatype == "tvshow": if mediatype == "tvshow":
peoplesql="INSERT OR REPLACE into actorlinktvshow(idActor, idShow, strRole, iOrder) values(?, ?, ?, ?)" peoplesql="INSERT OR REPLACE into actorlinktvshow(idActor, idShow, strRole, iOrder) values(?, ?, ?, ?)"
cursor.execute(peoplesql, (actorid,id,Role,None))
if mediatype == "episode": if mediatype == "episode":
peoplesql="INSERT OR REPLACE into actorlinkepisode(idActor, idEpisode, strRole, iOrder) values(?, ?, ?, ?)" peoplesql="INSERT OR REPLACE into actorlinkepisode(idActor, idEpisode, strRole, iOrder) values(?, ?, ?, ?)"
cursor.execute(peoplesql, (actorid,id,Role,None)) cursor.execute(peoplesql, (actorid,id,Role,None))
#### DIRECTORS ###### #### DIRECTORS ######
if(person.get("Type") == "Director"): if(person.get("Type") == "Director"):
@ -665,6 +666,8 @@ class WriteKodiDB():
peoplesql="INSERT OR REPLACE into directorlinktvshow(idDirector, idShow) values(?, ?)" peoplesql="INSERT OR REPLACE into directorlinktvshow(idDirector, idShow) values(?, ?)"
if mediatype == "musicvideo": if mediatype == "musicvideo":
peoplesql="INSERT OR REPLACE into directorlinkmusicvideo(idDirector, idMVideo) values(?, ?)" peoplesql="INSERT OR REPLACE into directorlinkmusicvideo(idDirector, idMVideo) values(?, ?)"
if mediatype == "episode":
peoplesql="INSERT OR REPLACE into directorlinkepisode(idDirector, idEpisode) values(?, ?)"
cursor.execute(peoplesql, (actorid,id)) cursor.execute(peoplesql, (actorid,id))
#### WRITERS ###### #### WRITERS ######
@ -678,9 +681,11 @@ class WriteKodiDB():
# Kodi Gotham or Helix database # # Kodi Gotham or Helix database #
if mediatype == "movie": if mediatype == "movie":
peoplesql="INSERT OR REPLACE into writerlinkmovie(idWriter, idMovie) values(?, ?)" peoplesql="INSERT OR REPLACE into writerlinkmovie(idWriter, idMovie) values(?, ?)"
cursor.execute(peoplesql, (actorid,id))
if mediatype == "episode": if mediatype == "episode":
peoplesql="INSERT OR REPLACE into writerlinkepisode(idWriter, idEpisode) values(?, ?)" peoplesql="INSERT OR REPLACE into writerlinkepisode(idWriter, idEpisode) values(?, ?)"
cursor.execute(peoplesql, (actorid,id)) cursor.execute(peoplesql, (actorid,id))
def AddGenresToMedia(self, id, genres, mediatype, cursor): def AddGenresToMedia(self, id, genres, mediatype, cursor):

View file

@ -19,6 +19,7 @@ from ConnectionManager import ConnectionManager
from ClientInformation import ClientInformation from ClientInformation import ClientInformation
from WebSocketClient import WebSocketThread from WebSocketClient import WebSocketThread
from UserClient import UserClient from UserClient import UserClient
from PlaybackUtils import PlaybackUtils
librarySync = LibrarySync() librarySync = LibrarySync()
@ -53,11 +54,8 @@ class Service():
lastProgressUpdate = datetime.today() lastProgressUpdate = datetime.today()
startupComplete = False startupComplete = False
#interval_FullSync = 600 WINDOW = xbmcgui.Window(10000)
#interval_IncrementalSync = 300
#cur_seconds_fullsync = interval_FullSync
#cur_seconds_incrsync = interval_IncrementalSync
user = UserClient() user = UserClient()
player = Player() player = Player()
@ -70,6 +68,11 @@ class Service():
if self.KodiMonitor.waitForAbort(1): if self.KodiMonitor.waitForAbort(1):
# Abort was requested while waiting. We should exit # Abort was requested while waiting. We should exit
break break
if WINDOW.getProperty("GUIPLAY") != "":
id = WINDOW.getProperty("GUIPLAY")
WINDOW.setProperty("GUIPLAY", "")
PlaybackUtils().PLAY(id)
if xbmc.Player().isPlaying(): if xbmc.Player().isPlaying():
try: try: