def add(name):
    subreddits[name] = {
        'phrases': [],
        'flairs': [],
        'include': False,
        'unflaired': True
    }
    update_subreddits(subreddits)
def clear_all():
    for name in subreddit_list():
        subreddits[name] = {
            'phrases': [],
            'flairs': [],
            'include': False,
            'unflaired': True
        }
    update_subreddits(subreddits)
def clear():
    subreddits.clear()
    update_subreddits(subreddits)
def remove(name):
    del subreddits[name]
    update_subreddits(subreddits)
def hide_unflaired(name):
    if subreddits[name]['unflaired']:
        subreddits[name]['unflaired'] = False
        update_subreddits(subreddits)
def exclude_filtered(name):
    if subreddits[name]['include']:
        subreddits[name]['include'] = False
        update_subreddits(subreddits)
def show_unflaired(name):
    if not subreddits[name]['unflaired']:
        subreddits[name]['unflaired'] = True
        update_subreddits(subreddits)
def include_filtered(name):
    if not subreddits[name]['include']:
        subreddits[name]['include'] = True
        update_subreddits(subreddits)
def remove_flair(name, flair):
    subreddits[name]['flairs'].remove(flair)
    update_subreddits(subreddits)
def add_flair(name, flair):
    subreddits[name]['flairs'].append(flair.lower())
    subreddits[name]['flairs'].sort()
    update_subreddits(subreddits)
def remove_phrase(name, phrase):
    subreddits[name]['phrases'].remove(phrase)
    update_subreddits(subreddits)
def add_phrase(name, phrase):
    subreddits[name]['phrases'].append(phrase.lower())
    subreddits[name]['phrases'].sort()
    update_subreddits(subreddits)