Skip to content

Commit

Permalink
Merge pull request #658 from Wolfy76700/feature/alt_text
Browse files Browse the repository at this point in the history
Fixed issue where empty character / player name slots were being used for alt text
  • Loading branch information
joaorb64 authored Nov 27, 2023
2 parents 482ea7b + b64e44b commit f50df14
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 83 deletions.
Binary file modified TSH.exe
Binary file not shown.
25 changes: 15 additions & 10 deletions src/Helpers/TSHAltTextHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ def generate_youtube(scoreboard_id=1, use_phase_name=True):
character_data = current_player_data.get("character")
for character_id in character_data.keys():
current_character_data = character_data.get(character_id)
character_names.append(current_character_data.get("name"))
player_names.append(player_name.replace(" [L]", ""))
if character_names:
player_names_with_characters.append(
f"{player_name.replace(' [L]', '')} ({', '.join(character_names)})")
else:
player_names_with_characters.append(
player_name.replace(" [L]", ""))
if current_character_data.get("name"):
character_names.append(current_character_data.get("name"))
if player_name:
if player_name.replace(' [L]', ''):
player_names.append(player_name.replace(" [L]", ""))
if character_names:
player_names_with_characters.append(
f"{player_name.replace(' [L]', '')} ({', '.join(character_names)})")
else:
player_names_with_characters.append(
player_name.replace(" [L]", ""))
title_long = f'{title_long}' + \
" / ".join(player_names_with_characters)
title_short = f'{title_short}' + " / ".join(player_names)
Expand Down Expand Up @@ -165,11 +168,13 @@ def CalculatePlacement(x, bracket_type="DOUBLE_ELIMINATION"):
character_data = current_player_data.get("character")
for character_id in character_data.keys():
current_character_data = character_data.get(character_id)
character_names.append(current_character_data.get("name"))
if current_character_data.get("name"):
character_names.append(current_character_data.get("name"))
player_text = f"{player_name}"
if character_names:
player_text = player_text + f" ({', '.join(character_names)})"
players_text.append(player_text)
if player_name:
players_text.append(player_text)
placement = CalculatePlacement(int(team_id), bracket_type)
players_text = " / ".join(players_text)
if team_name:
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,30 +703,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,30 +698,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,30 +708,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,30 +703,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation>Jeu :</translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation>contre</translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation>Commentateurs :</translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation>Stream produit avec Tournament Stream Helper :</translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation>Stream produit avec Tournament Stream Helper</translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,30 +698,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,30 +711,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,30 +710,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/i18n/TSH_zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,30 +698,30 @@ p, li { white-space: pre-wrap; }
<name>altText</name>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="30"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="147"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="150"/>
<source>Game:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="81"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="83"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="85"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="84"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="86"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="88"/>
<source>VS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="96"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="190"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="195"/>
<source>Commentators:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="99"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="102"/>
<source>Stream powered by TournamentStreamHelper:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Helpers/TSHAltTextHelper.py" line="194"/>
<location filename="../Helpers/TSHAltTextHelper.py" line="199"/>
<source>Stream powered by TournamentStreamHelper</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Loading

0 comments on commit f50df14

Please sign in to comment.