def can_import(handle, options): if "path" not in options: log('cannot execute "canimport" without path') xbmcmediaimport.setCanImport(handle, False) return path = unquote(options["path"][0]) # noqa F841 # pylint: disable=unused-variable # TODO(stub): check if the given path can be imported xbmcmediaimport.setCanImport(handle, True)
def canImport(handle, options): if not 'path' in options: log('cannot execute "canimport" without path') return path = unquote(options['path'][0]) # try to get the emby server's identifier from the path id = Server.GetServerId(path) if not id: return xbmcmediaimport.setCanImport(handle, True)
def canImport(handle: int, options: dict): """Validate that the 'path' in options references a PMS that can be imported :param handle: Handle id from input :type handle: int :param options: Options/parameters passed in with the call, 'path' required :type options: dict """ if 'path' not in options: log("cannot execute 'canimport' without path", xbmc.LOGERROR) return path = unquote(options['path'][0]) # try to get the Plex Media Server's identifier from the path identifier = getServerId(path) if not identifier: return xbmcmediaimport.setCanImport(handle, True)