def getAndMarkResumePoint(props, isTVShow): #search bookmarks for the ID and get the played time if exists checkURL = str(sys.argv[0].replace(r'|', sys.argv[2] + r'|')) urlsResumePoint = kodiDB.getPlayedURLResumePoint(checkURL) if urlsResumePoint: conTime = utils.zeitspanne(int(urlsResumePoint[0])) resume = [ "Jump to position : %s " % (str(conTime[5])), "Start from beginning!" ] if guiTools.selectDialog( resume, header='OSMOSIS: Would you like to continue?') == 0: xbmc.Player().seekTime(int(urlsResumePoint[0]) - 5) watched = 0 while xbmc.Player().isPlaying(): watched = xbmc.Player().getTime() * 100 / xbmc.Player().getTotalTime() time.sleep(1) time.sleep(1) if props: ID = props[0] fileID = props[1] pos = 0 total = 0 urlsWatchedPoint = kodiDB.getPlayedURLResumePoint(checkURL) if urlsWatchedPoint: pos = urlsWatchedPoint[0] total = urlsWatchedPoint[1] done = False elif urlsResumePoint and not urlsWatchedPoint: kodiDB.delBookMark(urlsResumePoint[2], fileID) done = True elif not urlsResumePoint and not urlsWatchedPoint: done = True if watched > 50 else False else: done = False guiTools.markMovie(ID, pos, total, done) if isTVShow == False else guiTools.markSeries( ID, pos, total, done)
try: # Exec play process xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # Wait until the media is started in player while meta.find("video") == -1: meta = xbmc.executeJSONRPC( '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' ) time.sleep(2) if xbmc.getInfoLabel("VideoPlayer.TVShowTitle") != "": guiTools.markSeries( xbmc.getInfoLabel("VideoPlayer.TVShowTitle"), xbmc.getInfoLabel("VideoPlayer.Episode"), xbmc.getInfoLabel("VideoPlayer.Season")) else: guiTools.markMovie(xbmc.getInfoLabel("VideoPlayer.Title")) except: pass elif mode == 100: create.fillPlugins(url) try: xbmcplugin.endOfDirectory(int(sys.argv[1])) except: pass elif mode == 101: create.fillPluginItems(url) if not fileSys.writeTutList("select:AddonNavi"): tutWin = [ "Adding content to your library ", "Search for your Movie, TV-Show or Music. ", "Mark/select content, do not play a Movie or enter a TV-Show. ",
item = xbmcgui.ListItem(path=url) # Gest infos from selectet media sPatToItem = xbmc.getInfoLabel("ListItem.path") sTitle = xbmc.getInfoLabel("ListItem.title") try: # Exec play process xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # Wait until the media is started in player while meta.find("video") == -1: meta = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}') time.sleep(2) if xbmc.getInfoLabel("VideoPlayer.TVShowTitle") != "": guiTools.markSeries(xbmc.getInfoLabel("VideoPlayer.TVShowTitle"),xbmc.getInfoLabel("VideoPlayer.Episode"),xbmc.getInfoLabel("VideoPlayer.Season")) else: guiTools.markMovie(xbmc.getInfoLabel("VideoPlayer.Title")) except: pass elif mode == 100: create.fillPlugins(url) try: xbmcplugin.endOfDirectory(int(sys.argv[1])) except: pass elif mode == 101: create.fillPluginItems(url) try: xbmcplugin.endOfDirectory(int(sys.argv[1])) except: pass
time.sleep(1) urlsWatchedPoint = kodiDB.getPlayedURLResumePoint(checkURL) if urlsWatchedPoint: pos = urlsWatchedPoint[0][0] total = urlsWatchedPoint[0][1] done = False elif urlsResumePoint and not urlsWatchedPoint: pos = urlsResumePoint[0][1] total = urlsResumePoint[0][1] kodiDB.delBookMark(urlsResumePoint[0][2], movFileID) done = True else: done = False if movID: guiTools.markMovie(movID, pos, total, done) except: pass elif mode == 100: create.fillPlugins(url) try: xbmcplugin.endOfDirectory(int(sys.argv[1])) except: pass elif mode == 101: create.fillPluginItems(url) if not fileSys.writeTutList("select:AddonNavi"): tutWin = ["Adding content to your library ", "Search for your Movie, TV-Show or Music. ", "Mark/select content, do not play a Movie or enter a TV-Show. ",