Sometimes in match stats there is a player that plays for one team in match stats API but in season squad this player is registered in another team. There should be a way to fix it neatly.
// TODO: fix neatly
// if player is registered in other club then this is API issue, skip such players
let clubPlayerOld = (await db.query(`SELECT * FROM club_player WHERE player_id = ? AND season_id = ?`, [playerId, seasonId]))[0];
if (!clubPlayer && clubPlayerOld) return;
Sometimes in match stats there is a player that plays for one team in match stats API but in season squad this player is registered in another team. There should be a way to fix it neatly.