Pringleman83 / SportsBook

A sports data scraping and analysis tool
GNU General Public License v3.0
82 stars 38 forks source link

Postponed games showing in fixtures #84

Closed Pringleman83 closed 5 years ago

Pringleman83 commented 5 years ago

When searching for fixtures within a specified range, the code only checks for the future date when it needs to stop looking. Eg. for fixtures over the next five days, it will gather all predictions for until 5 days from now.

In the scraping process, anything with a score is considered a result. If there is no score it is considered a fixture.

The problem is, if a game is postponed, the "P" from the score is replaced with "" and the game is being considered a fixture. As there is no filter for how far back to look when looking for fixtures, the postponed games still show in fixtures. There is some logic to this I guess, as the games still need to be played. However, if the game is refactored into the fixtures, it'll show twice.

Anyway, I need to change how this works so that postponed games are not shown in upcoming fixtures.

Pringleman83 commented 5 years ago

Issue fixed by checking each fixture is scheduled for today or afterwards before adding it to the fixtures list.

Pringleman83 commented 5 years ago

Still seeing a problem (currently with an Argentinian league). Issue reopened until I can sort this out.

Pringleman83 commented 5 years ago

Finally fixed this. A previous fix was focused on where fixtures are reduced based on the selected or default date / game range. However, predictions are ran on all fixtures (before this reduction takes place).

Fixture dates are now checked before the scraper function returns them.