コード例 #1
0
def _add_teams():
	team_ids = {}
	for invite_team in _ESEA_TF2_INVITE_TEAMS:
		name, fingerprint = invite_team
		indexed_name = views._get_indexed_name(name)
		team_id = db.add_team(
				name, indexed_name, _TF2_GAME, _TF2_INVITE_DIVISION, fingerprint)
		team_ids[fingerprint] = team_id
	return team_ids
コード例 #2
0
def _add_streamers(match_ids):
	streamer_ids = {}
	for twitch_id, name, display_name, logo in _TWITCH_TF2_STREAMERS:
		indexed_name = views._get_indexed_name(display_name)
		streamer_id, new_user = db.twitch_user_logged_in(
				twitch_id, name, display_name, indexed_name, logo, None)
		db.toggle_can_stream_by_twitch_id(twitch_id, True)
		streamer_ids[twitch_id] = streamer_id
	for streamer, match_fingerprint in _TWITCH_TF2_STREAMED_MATCHES:
		streamer_id = streamer_ids[streamer.twitch_id]
		match_id = match_ids[match_fingerprint]
		db.add_stream_match(streamer_id, match_id)
	return streamer_ids