def name_trait(name, add_info=False):
    """ Determine content type from name.
    """
    kind, info = None, {}

    # Anything to check against?
    if name and not name.startswith("VTS_"):
        lower_name = name.lower()
        trait_patterns = (("tv", TV_PATTERNS, "show"), ("movie", MOVIE_PATTERNS, "title"))

        # TV check
        if any(i in lower_name for i in _DEFINITELY_TV):
            kind = "tv"
            trait_patterns = trait_patterns[:1]

        # Regex checks
        re_name = '.'.join([i.lstrip('[(').rstrip(')]') for i in name.split(' .')])
        for trait, patterns, title_group in trait_patterns:
            matched, patname = None, None

            for patname, pattern in patterns:
                matched = pattern.match(re_name)
                ##print matched, patname, re_name; print "   ", pattern.pattern
                if matched and not any(i in matched.groupdict()[title_group].lower() for i in BAD_TITLE_WORDS):
                    kind, info = trait, matched.groupdict()
                    break

            if matched:
                info["pattern"] = patname

                # Fold auxiliary groups into main one
                for key, val in list(info.items()):
                    if key[-1].isdigit():
                        del info[key]
                        if val:
                            key = re.sub("[0-9]+$", "", key)
                            info[key] = ("%s %s" % (info.get(key) or "", val)).strip()
                break

        # TODO: Split by "dvdrip", year, etc. to get to the title and then
        # do a imdb / tvdb lookup; cache results, hits for longer, misses
        # for a day at max.

    # Return requested result
    return (kind, info) if add_info else kind
Determine content type from name.