Coder Social home page Coder Social logo

Comments (2)

nick-danger avatar nick-danger commented on September 23, 2024

It has to do with the API call to find the previous and next games. nhl_api/info.py at/about line 137 in team_previous_game(), there's a check for the truthiness of the results of fetching the team's schedule. It seems that if the team is done for the season, the API is returning an empty list. Two lines later, if the result was not truthy, the code nonetheless attempts to pull element 0 from the empty list and use it in an expression. I'm not certain what the original intent of that lump of code was, I've got a work-around that forces the previous game and next game data points to null when there's no data from the API call.

So if you're following a team that's out of the running, the team summary shows '--------' for the previous and next game data, but teams that still have upcoming games will show their next/previous games in the team summary.

But the above change caused another issue. At/about line 152 of data/scoreboard.py in Scoreboard.__init__(), the code presumes that overview["homeTeam"] and overview["awayTeam"]contain "onIce" elements. I haven't figured out why they don't, but it's probably a side effect of returning null for previous and next games from above. I've got a quick work around for this, but it feels like a hack. I need to trace what happens to the results from team_previous_game() to see if I can deduce what a useful non-answer would look like.

from nhl-led-scoreboard.

riffnshred avatar riffnshred commented on September 23, 2024

Fixed in 1.8.3

from nhl-led-scoreboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.