Beispiel #1
0
 def __init__(self):
     super(StreamContinuityManager, self).__init__()
     self.storage = common.PersistentStorage(__name__)
     self.current_show = None
     self.current_streams = {}
     self.player = xbmc.Player()
     self.did_restore = False
Beispiel #2
0
 def __init__(self):
     super(StreamContinuityManager, self).__init__()
     self.storage = common.PersistentStorage(__name__,
                                             no_save_on_destroy=True)
     self.current_videoid = None
     self.current_streams = {}
     self.player = xbmc.Player()
     self.did_restore = False
     self.resume = {}
 def init_persistent_storage(self):
     """
     Save on disk the data to keep in memory,
     at each screen change kodi reinitializes the addon
     making it impossible to have persistent variables
     """
     # This is ugly: Pass the common module into Cache.__init__ to work
     # around circular import dependencies.
     import resources.lib.common as common
     # In PersistentStorage "save on destroy" here cause problems because often gets destroyed by various behaviors
     self.PERSISTENT_STORAGE = common.PersistentStorage(
         __name__, no_save_on_destroy=True)
     # If missing create necessary keys
     if not self.PERSISTENT_STORAGE.get('menu_titles'):
         self.PERSISTENT_STORAGE['menu_titles'] = {}
     if not self.PERSISTENT_STORAGE.get('sub_menus'):
         self.PERSISTENT_STORAGE['sub_menus'] = {}