I think this might fix #466, but I have yet to witness the issue on my own hardware so I can't fully recreate it.
A few tweaks:
Completed games are no longer considered "live" (we have a separate "fresh" status for them, anyway)
The current_idx is now updated if the list of games got shorter in a refresh
_game_index_for_preferred_team no longer returns current_idx if it fails to find a preferred game - it returns -1
Removed a flag which was set when the 'preferred game' ended (which almost certainly didn't do the right thing during double headers, anyway)
Number 3 above is the cause of the issue @ty-porter noted on discord with a game being labelled as 'preferred' when it never should have been. Any of them could cause #466, IMO.
I think this might fix #466, but I have yet to witness the issue on my own hardware so I can't fully recreate it.
A few tweaks:
current_idx
is now updated if the list of games got shorter in a refresh_game_index_for_preferred_team
no longer returnscurrent_idx
if it fails to find a preferred game - it returns-1
Number 3 above is the cause of the issue @ty-porter noted on discord with a game being labelled as 'preferred' when it never should have been. Any of them could cause #466, IMO.