def process_match_details(match_id): '''Get the details of the given match_id, check if it's valid, and if it is, add it as a record in the database and spawn a thread to download and parse the corresponding replay.''' gmd = api.get_match_details(match_id)['result'] if not is_valid_match(gmd): logger.debug('Not considering match %s.' % match_id) return match_collection.insert(gmd) game_mode = get_game_mode_string(gmd['game_mode']) logger.debug('Processed Match ID: %s - Game Mode: %s' % (match_id, game_mode))