fixed multilinks

This commit is contained in:
Netali 2021-05-15 16:13:31 +02:00
parent 87e6c8eb08
commit 8b65b704da
1 changed files with 14 additions and 0 deletions

View File

@ -36,10 +36,24 @@ def show_match(tournament_id, match_id):
for idx, _ in enumerate(participant['lineup']):
participant['lineup'][idx]['custom_fields']['summoner_name'] = \
participant['lineup'][0]['custom_fields']
summoner_names = list()
for player in participant['lineup']:
summoner_names.append(player['custom_fields']['summoner_name'])
multilink_params = {
'query': ','.join(summoner_names)
}
participant['opgg_multilink'] = urllib.parse.urlencode(multilink_params)
elif participant['lineup'][0]['custom_fields'] == {}:
for idx, _ in enumerate(participant['lineup']):
participant['lineup'][idx]['custom_fields']['summoner_name'] = \
participant['lineup'][idx]['name']
summoner_names = list()
for player in participant['lineup']:
summoner_names.append(player['custom_fields']['summoner_name'])
multilink_params = {
'query': ','.join(summoner_names)
}
participant['opgg_multilink'] = urllib.parse.urlencode(multilink_params)
else:
for idx, _ in enumerate(participant['lineup']):
participant['lineup'][idx]['custom_fields']['summoner_name'] = 'N/V'