def _add_media_to_dir(media_list):
    """Add given list of direct links to the directory."""
    for media in media_list:
        directory.add_item(
            media['url'], 
            ListItem(media['title'], thumbnailImage=media['thumbnail_url'])
        )
def _show_subreddits(subreddit_dict):
    """Show given given subreddit_dict.
    
    Keys of dict are subreddit names, values are subreddit titles.

    """
    for subreddit in sorted(subreddit_dict):
        directory.add_dir(
            addon.base_url + 'r/%s/' % subreddit, _subreddit_item(subreddit))

    directory.add_item(
        addon.base_url + 'add_subreddit/', ListItem(_('Add subreddit')))
    directory.add_item(
        addon.base_url + 'remove_subreddit/', ListItem(_('Remove subreddit')))
    directory.end()