'Add a new root (parent) directory to SiCKRAGE'

def run(self):

    self.location = urllib.unquote_plus(self.location)
    location_matched = 0
    index = 0
    if (not os.path.isdir(self.location)):
        return _responds(RESULT_FAILURE, msg=u'Location    is    invalid')
    root_dirs = []
    if (sickrage.srCore.srConfig.ROOT_DIRS == u''):
        self.default = 1
    else:
        root_dirs = sickrage.srCore.srConfig.ROOT_DIRS.split(u'|')
        index = int(sickrage.srCore.srConfig.ROOT_DIRS.split(u'|')[0])
        root_dirs.pop(0)
        root_dirs = [urllib.unquote_plus(x) for x in root_dirs]
        for x in root_dirs:
            if (x == self.location):
                location_matched = 1
                if (self.default == 1):
                    index = root_dirs.index(self.location)
                break
    if (location_matched == 0):
        if (self.default == 1):
            root_dirs.insert(0, self.location)
        else:
            root_dirs.append(self.location)
    root_dirs_new = [urllib.unquote_plus(x) for x in root_dirs]
    root_dirs_new.insert(0, index)
    root_dirs_new = u'|'.join((x for x in root_dirs_new))
    sickrage.srCore.srConfig.ROOT_DIRS = root_dirs_new
    return _responds(RESULT_SUCCESS, _getRootDirs(), msg=u'Root    directories    updated')
