Standings update and dem_week bug fix
This commit is contained in:
parent
ebab737093
commit
cebe2d3842
@ -822,19 +822,19 @@ class Players(commands.Cog):
|
||||
|
||||
async def get_division_standings(self, current) -> discord.Embed:
|
||||
d1_query = await db_get('standings', params=[
|
||||
('season', current['season']), ('division_abbrev', 'FD')
|
||||
('season', current['season']), ('division_abbrev', 'GOLD')
|
||||
])
|
||||
div_one = d1_query['standings']
|
||||
d2_query = await db_get('standings', params=[
|
||||
('season', current['season']), ('division_abbrev', 'NLW')
|
||||
('season', current['season']), ('division_abbrev', 'CHOAS')
|
||||
])
|
||||
div_two = d2_query['standings']
|
||||
d3_query = await db_get('standings', params=[
|
||||
('season', current['season']), ('division_abbrev', 'IWGP')
|
||||
('season', current['season']), ('division_abbrev', 'WHACK')
|
||||
])
|
||||
div_three = d3_query['standings']
|
||||
d4_query = await db_get('standings', params=[
|
||||
('season', current['season']), ('division_abbrev', 'BAL')
|
||||
('season', current['season']), ('division_abbrev', 'STAB')
|
||||
])
|
||||
div_four = d4_query['standings']
|
||||
|
||||
@ -864,10 +864,10 @@ class Players(commands.Cog):
|
||||
f'{progress["games_played"]}/{progress["game_count"]} games played',
|
||||
color=0xB70000)
|
||||
embed.add_field(name=f'**Full Standings**', value=SBA_STANDINGS_URL, inline=False)
|
||||
embed.add_field(name=f'**Fun Diff**', value=div_one_standings, inline=False)
|
||||
embed.add_field(name=f'**NL West**', value=div_two_standings, inline=False)
|
||||
embed.add_field(name=f'**IWGP**', value=div_three_standings, inline=False)
|
||||
embed.add_field(name=f'**Crabbers**', value=div_four_standings, inline=False)
|
||||
embed.add_field(name=f'**Golden Oldies**', value=div_one_standings, inline=False)
|
||||
embed.add_field(name=f'**Choas**', value=div_two_standings, inline=False)
|
||||
embed.add_field(name=f'**Whack**', value=div_three_standings, inline=False)
|
||||
embed.add_field(name=f'**Stab**', value=div_four_standings, inline=False)
|
||||
|
||||
return embed
|
||||
|
||||
@ -1256,13 +1256,17 @@ class Players(commands.Cog):
|
||||
'unused-pinchrunner', 'unused-order', 'hand_batting', 'hand_pitching', 're24_primary', 're24_running'
|
||||
]
|
||||
p_data = []
|
||||
final_inning = 0
|
||||
for line in all_plays:
|
||||
this_data = {'game_id': this_game['id']}
|
||||
for count, x in enumerate(line):
|
||||
if x != '':
|
||||
this_data[play_keys[count]] = x
|
||||
if len(this_data.keys()) > 5:
|
||||
p_data.append(this_data)
|
||||
final_inning = line[6]
|
||||
|
||||
logging.info(f'players - final_inning: {final_inning}')
|
||||
logging.info(f'p_data: {p_data}')
|
||||
# Post plays
|
||||
try:
|
||||
@ -1282,7 +1286,9 @@ class Players(commands.Cog):
|
||||
except pygsheets.WorksheetNotFound as e:
|
||||
sc_tab = scorecard.worksheet_by_title('Box Score')
|
||||
score_table = sc_tab.get_values('T6', 'V7')
|
||||
final_inning = all_plays[len(all_plays) - 1][6]
|
||||
logging.info(f'players - score_table: {score_table}')
|
||||
# final_inning = all_plays[len(all_plays) - 1][6]
|
||||
# logging.info(f'players - final_inning: {final_inning}')
|
||||
|
||||
# Log game result
|
||||
try:
|
||||
|
||||
@ -178,7 +178,13 @@ async def get_player_by_name(season: int, player_name: str):
|
||||
p_query = await db_get('players', params=[('name', player_name), ('season', season)])
|
||||
if p_query['count'] == 0:
|
||||
return None
|
||||
return p_query['players'][0]
|
||||
|
||||
player = p_query['players'][0]
|
||||
if player['demotion_week'] is None:
|
||||
player['demotion_week'] = 0
|
||||
await patch_player(player)
|
||||
|
||||
return player
|
||||
|
||||
|
||||
async def patch_player(this_player: dict):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user