Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_fixtures method not returning fixtures without game week #93

Closed
177arc opened this issue Sep 5, 2020 · 1 comment
Closed

get_fixtures method not returning fixtures without game week #93

177arc opened this issue Sep 5, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@177arc
Copy link

177arc commented Sep 5, 2020

Currently, the get_fixtures method is not returning fixtures without game week, e.g. at the point of writing the fixture with id 379 is not returned because it is not scheduled yet and therefore has no game week. The current implementation of the function iterates over all game week and retrieves the fixtures for these game weeks.

Should the method not simply return all fixtures as per below?

async def __fpl_get_fixtures(self, return_json=False):
        """Returns a list of *all* fixtures.

        Information is taken from e.g.:
            https://fantasy.premierleague.com/api/fixtures/
            https://fantasy.premierleague.com/api/fixtures/?event=1

        :param return_json: (optional) Boolean. If ``True`` returns a list of
            ``dict``s, if ``False`` returns a list of  :class:`Fixture`
            objects. Defaults to ``False``.
        :type return_json: bool
        :rtype: list
        """
        fixtures = await fetch(self.session, API_URLS["fixtures"])

        if return_json:
            return fixtures

        return [Fixture(fixture) for fixture in fixtures]
@amosbastian
Copy link
Owner

Should be fixed thanks to @HaydenMacDonald.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants