Пример #1
0
 def triage(self, item):
     _, params = item.split('?', 1)
     params = dict(parse_qsl(params))
     mode = params.get('mode')
     log.debug('Received mode: %s, params: %s' % (mode, params))
     try:
         if mode == 'play':
             result = self.process_play(params.get('id'),
                                        params.get('dbid'))
         elif mode == 'companion':
             result = self.process_companion()
         elif mode == 'plex_node':
             result = self.process_plex_node(
                 params.get('key'),
                 params.get('view_offset'),
                 directplay=True if params.get('play_directly') else False,
                 node=False if params.get('node') == 'false' else True)
         elif mode == 'context_menu':
             ContextMenu()
             result = Playback_Successful()
     except:
         log.error('Error encountered for mode %s, params %s' %
                   (mode, params))
         import traceback
         log.error(traceback.format_exc())
         # Let default.py know!
         pickle_me(None)
     else:
         pickle_me(result)
Пример #2
0
 def triage(self, item):
     _, params = item.split('?', 1)
     params = dict(parse_qsl(params))
     mode = params.get('mode')
     LOG.debug('Received mode: %s, params: %s', mode, params)
     if mode == 'play':
         playback.playback_triage(plex_id=params.get('plex_id'),
                                  plex_type=params.get('plex_type'),
                                  path=params.get('path'))
     elif mode == 'plex_node':
         playback.process_indirect(params['key'], params['offset'])
     elif mode == 'context_menu':
         ContextMenu(kodi_id=params['kodi_id'],
                     kodi_type=params['kodi_type'])
Пример #3
0
 def triage(self, item):
     _, params = item.split('?', 1)
     params = dict(parse_qsl(params))
     mode = params.get('mode')
     LOG.debug('Received mode: %s, params: %s', mode, params)
     if mode == 'play':
         playback.playback_triage(plex_id=params.get('plex_id'),
                                  plex_type=params.get('plex_type'),
                                  path=params.get('path'))
     elif mode == 'plex_node':
         playback.process_indirect(params['key'], params['offset'])
     elif mode == 'context_menu':
         ContextMenu()
         result = Playback_Successful()
         # Let default.py know!
         pickle_me(result)
Пример #4
0
import xbmc
import xbmcaddon

#################################################################################################

_ADDON = xbmcaddon.Addon(id='plugin.video.emby')
_CWD = _ADDON.getAddonInfo('path').decode('utf-8')
_BASE_LIB = xbmc.translatePath(os.path.join(_CWD, 'resources',
                                            'lib')).decode('utf-8')
sys.path.append(_BASE_LIB)

#################################################################################################

import loghandler
from context_entry import ContextMenu

#################################################################################################

loghandler.config()
log = logging.getLogger("EMBY.contextmenu")

#################################################################################################

if __name__ == "__main__":

    try:
        # Start the context menu
        ContextMenu()
    except Exception as error:
        log.exception(error)