def METHOD_NAME(config, db, update_db=True):
	info("Matching streams to shows")
	streams = db.get_streams(unmatched=True)
	if len(streams) == 0:
		debug("  No unmatched streams")
		return
	# Check each link site
	for site in db.get_link_sites():
		debug("  Checking service: {}".format(site.key))
		handler = services.get_link_handler(site)
		# Check remaining streams
		for stream in list(streams):								# Iterate over copy of stream list allow removals
			debug("    Checking stream: {}".format(stream.name))
			raw_shows = handler.find_show(stream.name, useragent=config.useragent)
			if len(raw_shows) == 1:
				# Show info found
				raw_show = raw_shows.pop()
				debug("      Found show: {}".format(raw_show.name))
				# Search stored names for show matches
				shows = db.search_show_ids_by_names(raw_show.name, *raw_show.more_names)
				if len(shows) == 1:
					# All the planets are aligned
					# Connect the stream and show and save the used name
					show_id = shows.pop()
					if update_db:
						db.update_stream(stream, show=show_id, active=True)
						db.add_show_names(stream.name, id=show_id, commit=False)
					streams.remove(stream)
				elif len(shows) == 0:
					warning("      No shows known")
				else:
					warning("      Multiple shows known")
			elif len(raw_shows) == 0:
				warning("    No shows found")
			else:
				warning("    Multiple shows found")
		if update_db:
			db.commit()