From 3803e9f9c252df4262414385d5502e402786cee9 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 22 Sep 2024 13:41:29 -0400 Subject: [PATCH] Fix grammar around NCAAF team names The changed response from ESPN resulted in teams being called "the Michigan" etc instead of "the Wolverines". So I removed the "the" for NCAAF games. --- custom_templates/sports.jinja | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/custom_templates/sports.jinja b/custom_templates/sports.jinja index ce8ca92..eee4151 100644 --- a/custom_templates/sports.jinja +++ b/custom_templates/sports.jinja @@ -17,7 +17,7 @@ {% if is_state(team,'PRE') %} {% set date = state_attr(team,'date') | as_timestamp | timestamp_custom('%m-%d') %} {% if date == now().strftime('%m-%d') %} - The {{ state_attr(team,'friendly_name') }} will be playing today against the {{ state_attr(team,'opponent_name') }} at {{ state_attr(team,'venue') }}. + The {{ state_attr(team,'friendly_name') }} will be playing today against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} at {{ state_attr(team,'venue') }}. {{ sports_str(team,'start') }} is at {{ state_attr(team,'date') | as_timestamp | timestamp_custom('%I:%M %p') }}. {% endif %} {% endif %} @@ -34,11 +34,11 @@ {% if state_attr(team,'clock') in ['postponed','Postponed'] %} The {{ state_attr(team,'friendly_name') }} had their game postponed today, and it will be played at a later date. {% elif (state_attr(team,'team_score') | int) == state_attr(team,'opponent_score') | int %} - The {{ state_attr(team,'friendly_name') }} tied in their game today against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} tied in their game today against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% elif state_attr(team,'team_winner') == true %} - The {{ state_attr(team,'friendly_name') }} won their game today against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} won their game today against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% elif state_attr(team,'opponent_winner') == true %} - The {{ state_attr(team,'friendly_name') }} lost their game today against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. + The {{ state_attr(team,'friendly_name') }} lost their game today against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. {% endif %} {% if state_attr(team,'clock') not in ['postponed','Postponed'] %} This brings their record to {{ state_attr(team,'team_record') | replace("-"," and ") }} on the season. @@ -47,11 +47,11 @@ {% if state_attr(team,'clock') in ['postponed','Postponed'] %} The {{ state_attr(team,'friendly_name') }} had their game postponed yesterday, and it will be played at a later date. {% elif (state_attr(team,'team_score') | int) == state_attr(team,'opponent_score') | int %} - The {{ state_attr(team,'friendly_name') }} tied in their game yesterday against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} tied in their game yesterday against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% elif state_attr(team,'team_winner') == true %} - The {{ state_attr(team,'friendly_name') }} won their game yesterday against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} won their game yesterday against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% elif state_attr(team,'opponent_winner') == true %} - The {{ state_attr(team,'friendly_name') }} lost their game yesterday against the {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. + The {{ state_attr(team,'friendly_name') }} lost their game yesterday against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} by a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. {% endif %} {% if state_attr(team,'clock') not in ['postponed','Postponed'] %} This brings their record to {{ state_attr(team,'team_record') | replace("-"," and ") }} on the season. @@ -59,11 +59,11 @@ {% endif %} {% elif is_state(team,'IN') %} {% if (state_attr(team,'team_score') | int) == (state_attr(team,'opponent_score') | int) %} - The {{ state_attr(team,'friendly_name') }} are currently tied in their game against the {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} are currently tied in their game against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% elif (state_attr(team,'team_score') | int) > (state_attr(team,'opponent_score') | int) %} - The {{ state_attr(team,'friendly_name') }} are currently winning their game against the {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. + The {{ state_attr(team,'friendly_name') }} are currently winning their game against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'team_score') }} to {{ state_attr(team,'opponent_score') }}. {% else %} - The {{ state_attr(team,'friendly_name') }} are currently losing their game against the {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. + The {{ state_attr(team,'friendly_name') }} are currently losing their game against {% if state_attr(team,'league') != 'NCAAF'%}the{% endif %} {{ state_attr(team,'opponent_name') }} with a score of {{ state_attr(team,'opponent_score') }} to {{ state_attr(team,'team_score') }}. {% endif %} {% endif %} {% endmacro %}