def METHOD_NAME():
    get_sonarr_rootfolder()
    rootfolder = TableShowsRootfolder.select(TableShowsRootfolder.id, TableShowsRootfolder.path).dicts()
    for item in rootfolder:
        root_path = item['path']
        if not root_path.endswith(('/', '\\')):
            if root_path.startswith('/'):
                root_path += '/'
            else:
                root_path += '\\'
        if not os.path.isdir(path_mappings.path_replace(root_path)):
            TableShowsRootfolder.update({TableShowsRootfolder.accessible: 0,
                                         TableShowsRootfolder.error: 'This Sonarr root directory does not seems to '
                                                                     'be accessible by  Please check path '
                                                                     'mapping.'})\
                .where(TableShowsRootfolder.id == item['id'])\
                .execute()
        elif not os.access(path_mappings.path_replace(root_path), os.W_OK):
            TableShowsRootfolder.update({TableShowsRootfolder.accessible: 0,
                                         TableShowsRootfolder.error: 'Bazarr cannot write to this directory.'}) \
                .where(TableShowsRootfolder.id == item['id']) \
                .execute()
        else:
            TableShowsRootfolder.update({TableShowsRootfolder.accessible: 1,
                                         TableShowsRootfolder.error: ''}) \
                .where(TableShowsRootfolder.id == item['id']) \
                .execute()