diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 0dc5110f..db958c60 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -464,8 +464,10 @@ def play_from_library(item): # logger.debug("item: \n" + item.tostring('\n')) # Try to reproduce an image (this does nothing and also does not give an error) - xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - xbmc.Player().stop() + platformtools.prevent_busy(item) + # xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + # xbmc.sleep(200) + # xbmc.Player().stop() # Modify the action (currently the video library needs "findvideos" since this is where the sources are searched item.action = "findvideos" diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 25882fa6..41fd32de 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1012,12 +1012,6 @@ def set_player(item, xlistitem, mediaurl, view, strm): item.options = {'strm':False, 'continue':False} # logger.debug("item:\n" + item.tostring('\n')) - # Prevent Busy - if not item.autoplay: - if item.globalsearch: xbmc.executebuiltin("PlayMedia(" + os.path.join(config.get_runtime_path(), "resources", "kod.mp4") + ")") - else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - xbmc.Player().stop() - # Moved del conector "torrent" here if item.server == "torrent": play_torrent(item, xlistitem, mediaurl) @@ -1441,3 +1435,10 @@ def set_played_time(item): else: c.execute("INSERT INTO viewed (tmdb_id, episode, played_time) VALUES (?, ?, ?)", (ID, E, item.played_time)) conn.commit() conn.close() + +def prevent_busy(item): + if not item.autoplay: + if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + xbmc.sleep(200) + xbmc.Player().stop() \ No newline at end of file diff --git a/specials/globalsearch.py b/specials/globalsearch.py index b11dd11a..4669eba9 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -import xbmc, xbmcgui, sys, channelselector, time, gc -from core.support import dbg, typo, tmdb +import xbmc, xbmcgui, sys, channelselector, time +from core.support import dbg, tmdb from core.item import Item from core import channeltools, servertools, scrapertools from platformcode import platformtools, config, logger @@ -329,7 +329,6 @@ class SearchWindow(xbmcgui.WindowXMLDialog): def makeItem(self, url): item = Item().fromurl(url) - logger.debug(item) channelParams = channeltools.get_channel_parameters(item.channel) thumb = item.thumbnail if item.thumbnail else 'Infoplus/' + item.contentType.replace('show', '') + '.png' logger.info('THUMB', thumb) @@ -434,7 +433,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog): self.PROGRESS = self.getControl(PROGRESS) self.COUNT = self.getControl(COUNT) self.MAINTITLE = self.getControl(MAINTITLE) - self.MAINTITLE.setText(typo(config.get_localized_string(30993).replace('...', '') % '"%s"' % self.item.text, 'bold')) + self.MAINTITLE.setText(config.get_localized_string(30993).replace('...', '') % '"%s"' % self.item.text) self.SEARCH = self.getControl(SEARCH) self.EPISODES = self.getControl(EPISODES) self.EPISODESLIST = self.getControl(EPISODESLIST) @@ -744,6 +743,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog): def playmonitor(self, server=None): if server: server.globalsearch = True + platformtools.prevent_busy(server) run(server) try: while not xbmc.Player().getTime() > 0: