'Delete a root (parent) directory from SickRage'

def run(self):

    if (sickbeard.ROOT_DIRS == u''):
        return _responds(RESULT_FAILURE, _get_root_dirs(), msg=u'No    root    directories    detected')
    new_index = 0
    root_dirs_new = []
    root_dirs = sickbeard.ROOT_DIRS.split(u'|')
    index = int(root_dirs[0])
    root_dirs.pop(0)
    root_dirs = [urllib.parse.unquote_plus(x) for x in root_dirs]
    old_root_dir = root_dirs[index]
    for curRootDir in root_dirs:
        if (not (curRootDir == self.location)):
            root_dirs_new.append(curRootDir)
        else:
            new_index = 0
    for (curIndex, curNewRootDir) in enumerate(root_dirs_new):
        if (curNewRootDir is old_root_dir):
            new_index = curIndex
            break
    root_dirs_new = [urllib.parse.unquote_plus(x) for x in root_dirs_new]
    if (len(root_dirs_new) > 0):
        root_dirs_new.insert(0, new_index)
    root_dirs_new = u'|'.join((six.text_type(x) for x in root_dirs_new))
    sickbeard.ROOT_DIRS = root_dirs_new
    return _responds(RESULT_SUCCESS, _get_root_dirs(), msg=u'Root    directory    deleted')
