Beispiel #1
0
    def set_view_type(self, content_type):
        def _execute_set_view_mode(view):
            xbmc.sleep(200)
            xbmc.executebuiltin("Container.SetViewMode({})".format(view))

        if self.get_bool_setting(
                "general.setViews") and self.is_addon_visible():
            view_type = self.get_view_type(content_type)
            if view_type > 0:
                tools.run_threaded(_execute_set_view_mode, view_type)
Beispiel #2
0
 def close_directory(self, content_type, sort=False, cache=False):
     if sort == "title":
         xbmcplugin.addSortMethod(
             self.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
         )
     if sort == "episode":
         xbmcplugin.addSortMethod(self.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_EPISODE)
     if not sort:
         xbmcplugin.addSortMethod(self.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_NONE)
     xbmcplugin.setContent(self.PLUGIN_HANDLE, content_type)
     menu_caching = self.get_bool_setting("general.menucaching") or cache
     xbmcplugin.endOfDirectory(self.PLUGIN_HANDLE, cacheToDisc=menu_caching)
     tools.run_threaded(self.set_view_type, content_type)