ffverse / ffscrapr

R API Client for Fantasy Football League Platforms
https://ffscrapr.ffverse.com
Other
84 stars 21 forks source link

ff_schedule include sleeper playoffs #289

Closed draftydesert277 closed 3 years ago

draftydesert277 commented 3 years ago

I noticed that ff_schedule() pulls playoff data for MFL but not Sleeper. I'm able to see the playoff schedule data by calling the sleeper matchups API directly (e.g. "week = 14" in my 13-game league).

The only way around this that I've found is rebuilding the schedule data by hand using httr & jsonlite, but I assume that's kind of the point of ff_schedule() to begin with. I'm sure this was done for a good reason but curious what the options are here. Thanks!

tanho63 commented 3 years ago

Hiya! Great question. I don't recall why I wrote this logic in, to be honest...

https://github.com/dynastyprocess/ffscrapr/blob/main/R/sleeper_schedule.R#L19-L27

tanho63 commented 3 years ago

Hmm, I probably wrote that because there wasn't a playoff matchup to pull pre-season and it caused breakage if you tried pulling it.

Could figure out the maximum of regular_season_end + last_scored_week and take the higher of the two...

draftydesert277 commented 3 years ago

Makes sense, hadn't considered that! That seems like it would work. I assume MFL doesn't create similar headaches when pulling schedule info mid-season.

I'm working on some league history type analysis (e.g. best playoff performers), so I'm pulling all weeks and then flagging 14-16 as playoffs after the fact.

tanho63 commented 3 years ago

Okay, this should be resolved by dev version 1.4.2.03 and later

draftydesert277 commented 3 years ago

Just downloaded the dev version and this is working - thanks!

tanho63 commented 3 years ago

Included in v1.4.3 released today