This commit is contained in:
2026-09-27 00:47:30 +03:00
parent 96bbbaf36e
commit 3213d1cf72
16 changed files with 945 additions and 129 deletions

View File

@@ -146,7 +146,9 @@ class KhlCareerService:
if not goalie:goalie=any(x in str((data.get('profile') or {}).get('role')).casefold() for x in ('врат','goal'))
stats['available']=bool(stats);stats['kind']='goalkeeper' if goalie else 'skater'
item={'id':p.external_id,'external_id':p.external_id,'side':side,'number':num,'name':(en if language=='en' else ru) or ru or en,
'role':'goalkeeper' if goalie else 'skater','position':role,'in_match':in_match,'country_code':p.country_code,'birth_date':dob,'photo_url':p.photo_url,
'names':{'ru':ru or data.get('name',''),'en':en or data.get('name_en','')},
'role':'goalkeeper' if goalie else 'skater','position':role,'in_match':in_match,'country_code':p.country_code,'birth_date':dob or (record.birth_date if record else ''),'photo_url':p.photo_url,
'birth_date_source':'player_directory' if dob else 'KHL.ru' if record and record.birth_date else '',
'khl_id':record.khl_id if record else '', 'source_updated_at':data.get('source_updated_at',''),'source_url':data.get('source_url',''),
'career_status':'available' if stats['available'] else 'no_statistics' if record else 'unmatched','season_statistics':stats}
result[side]['goalkeepers' if goalie else 'skaters'].append(item)