'Sends a NMJ update command to the specified machine
host: The hostname/IP to send the request to (no port)
database: The database to send the request to
mount: The mount URL to use (optional)
Returns: True if the request succeeded, False otherwise'

def _sendNMJ(self, host):

    try:
        url_scandir = ((((u'http://' + host) + u':8008/metadata_database?arg0=update_scandir&arg1=') + sickbeard.NMJv2_DATABASE) + u'&arg2=&arg3=update_all')
        logger.log(u'NMJ    scan    update    command    sent    to    host:    {0}'.format(host), logger.DEBUG)
        url_updatedb = ((((u'http://' + host) + u':8008/metadata_database?arg0=scanner_start&arg1=') + sickbeard.NMJv2_DATABASE) + u'&arg2=background&arg3=')
        logger.log(u'Try    to    mount    network    drive    via    url:    {0}'.format(host), logger.DEBUG)
        prereq = urllib.request.Request(url_scandir)
        req = urllib.request.Request(url_updatedb)
        handle1 = urllib.request.urlopen(prereq)
        response1 = handle1.read()
        time.sleep((300.0 / 1000.0))
        handle2 = urllib.request.urlopen(req)
        response2 = handle2.read()
    except IOError as e:
        logger.log(u"Warning:    Couldn't    contact    popcorn    hour    on    host    {0}:    {1}".format(host, e), logger.WARNING)
        return False
    try:
        et = etree.fromstring(response1)
        result1 = et.findtext(u'returnValue')
    except SyntaxError as e:
        logger.log(u'Unable    to    parse    XML    returned    from    the    Popcorn    Hour:    update_scandir,    {0}'.format(e), logger.ERROR)
        return False
    try:
        et = etree.fromstring(response2)
        result2 = et.findtext(u'returnValue')
    except SyntaxError as e:
        logger.log(u'Unable    to    parse    XML    returned    from    the    Popcorn    Hour:    scanner_start,    {0}'.format(e), logger.ERROR)
        return False
    error_codes = [u'8', u'11', u'22', u'49', u'50', u'51', u'60']
    error_messages = [u'Invalid    parameter(s)/argument(s)', u'Invalid    database    path', u'Insufficient    size', u'Database    write    error', u'Database    read    error', u'Open    fifo    pipe    failed', u'Read    only    file    system']
    if (int(result1) > 0):
        index = error_codes.index(result1)
        logger.log(u'Popcorn    Hour    returned    an    error:    {0}'.format(error_messages[index]), logger.ERROR)
        return False
    elif (int(result2) > 0):
        index = error_codes.index(result2)
        logger.log(u'Popcorn    Hour    returned    an    error:    {0}'.format(error_messages[index]), logger.ERROR)
        return False
    else:
        logger.log(u'NMJv2    started    background    scan', logger.INFO)
        return True
