From e77d5c7c532720996a8e38577d649c4da15c2a76 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 1 May 2015 18:32:13 +0200 Subject: [PATCH] some more fixes --- default.py | 3 ++- resources/lib/WriteKodiDB.py | 13 +++++++++---- service.py | 13 ++++++++----- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/default.py b/default.py index 300619d7..ef97285d 100644 --- a/default.py +++ b/default.py @@ -27,7 +27,8 @@ except: id=None 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": utils.reset() else: diff --git a/resources/lib/WriteKodiDB.py b/resources/lib/WriteKodiDB.py index bfdd7cab..26727583 100644 --- a/resources/lib/WriteKodiDB.py +++ b/resources/lib/WriteKodiDB.py @@ -43,7 +43,6 @@ class WriteKodiDB(): else: downloadUtils.downloadUrl(watchedurl, type="DELETE") - def addOrUpdateMovieToKodiLibrary( self, embyId ,connection, cursor, viewTag): addon = xbmcaddon.Addon(id='plugin.video.emby') @@ -100,7 +99,7 @@ class WriteKodiDB(): jsonData = downloadUtils.downloadUrl(itemTrailerUrl) if(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: dateadded = MBitem["DateCreated"].replace("T"," ") @@ -644,11 +643,13 @@ class WriteKodiDB(): # Kodi Gotham or Helix database # if mediatype == "movie": peoplesql="INSERT OR REPLACE into actorlinkmovie(idActor, idMovie, strRole, iOrder) values(?, ?, ?, ?)" + cursor.execute(peoplesql, (actorid,id,Role,None)) if mediatype == "tvshow": peoplesql="INSERT OR REPLACE into actorlinktvshow(idActor, idShow, strRole, iOrder) values(?, ?, ?, ?)" + cursor.execute(peoplesql, (actorid,id,Role,None)) if mediatype == "episode": 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 ###### if(person.get("Type") == "Director"): @@ -665,6 +666,8 @@ class WriteKodiDB(): peoplesql="INSERT OR REPLACE into directorlinktvshow(idDirector, idShow) values(?, ?)" if mediatype == "musicvideo": 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)) #### WRITERS ###### @@ -678,9 +681,11 @@ class WriteKodiDB(): # Kodi Gotham or Helix database # if mediatype == "movie": peoplesql="INSERT OR REPLACE into writerlinkmovie(idWriter, idMovie) values(?, ?)" + cursor.execute(peoplesql, (actorid,id)) if mediatype == "episode": 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): diff --git a/service.py b/service.py index 72d4e045..4c84511d 100644 --- a/service.py +++ b/service.py @@ -19,6 +19,7 @@ from ConnectionManager import ConnectionManager from ClientInformation import ClientInformation from WebSocketClient import WebSocketThread from UserClient import UserClient +from PlaybackUtils import PlaybackUtils librarySync = LibrarySync() @@ -53,11 +54,8 @@ class Service(): lastProgressUpdate = datetime.today() startupComplete = False - #interval_FullSync = 600 - #interval_IncrementalSync = 300 - - #cur_seconds_fullsync = interval_FullSync - #cur_seconds_incrsync = interval_IncrementalSync + WINDOW = xbmcgui.Window(10000) + user = UserClient() player = Player() @@ -70,6 +68,11 @@ class Service(): if self.KodiMonitor.waitForAbort(1): # Abort was requested while waiting. We should exit break + + if WINDOW.getProperty("GUIPLAY") != "": + id = WINDOW.getProperty("GUIPLAY") + WINDOW.setProperty("GUIPLAY", "") + PlaybackUtils().PLAY(id) if xbmc.Player().isPlaying(): try: