MLB-LED-Scoreboard / mlb-led-scoreboard

An LED scoreboard for Major League Baseball :baseball:
GNU General Public License v3.0
599 stars 105 forks source link

Integrate broadcast service into pregame info #365

Closed twfarley closed 1 year ago

twfarley commented 2 years ago

https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=2022-04-10&hydrate=broadcasts

WardBrian commented 2 years ago

There will be two difficulties with this:

One, the schedule is one of the few places we call a function in statsapi rather than using the endpoint directly. So, we’d probably want to add this to the schedule function there, see: https://github.com/toddrob99/MLB-StatsAPI/issues/71

Secondly, this is not available from the game endpoint, so it will need to be passed in from the constructor. This isn’t a conceptually difficult thing to do, but it’s unfortunate from a standpoint of code cleanliness

WardBrian commented 2 years ago

I have a working branch that does this here: https://github.com/WardBrian/mlb-led-scoreboard/tree/pregame-broadcast

It depends on https://github.com/toddrob99/MLB-StatsAPI/pull/85

ZachPL commented 2 years ago

I'm going to try this out soon, thanks

you're project is exactly what i'm looking to do!

WardBrian commented 2 years ago

For now I just stuck it at the end of the starting pitchers preview

ZachPL commented 2 years ago

@WardBrian I commented out the is isnational check, in order for it to show for example YES network for the yankees, it might not be ideal for it to show all broadcasts including radio stations espeicially for everyone, but maybe a parameter to turn that on or off?

This year the yankees can be on prime, youtube, yes, national broadcasts, so it's pretty convenient to show them all.

WardBrian commented 2 years ago

My theory is if it doesn’t say anything, you should be able to know it’s the default (E.g all of those besides YES should be marked as national)

ZachPL commented 2 years ago

That makes sense, for my use case my grandpa texts me every day what channel the game is on and I know if it doesn't say specifically he will have questions.