ffverse / ffscrapr

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

ff_playerscores() returning wrong or missing team #412

Closed TheMathNinja closed 1 year ago

TheMathNinja commented 1 year ago

I'm running

ff_playerscores(mfl_connect(season = 2022, league_id = 22686),
                                                       season = 2022,
                                                       week = 1:17)

and noticing that quite a few entries include FA for the team variable (Devon Kennard weeks 1-8, for example), and Roquan Smith is showing BAL for teamall year long, even though he played the first half of the year on CHI. Is there a way you can get this function to show/return what team the player was on the week he scored the points, rather than importing the team he finished the year with as his team for each week?

Expected behavior I expect each week to show the team the player was on when he recorded his stats.

Session information Please copy the output of ffscrapr::ffverse_sitrep() into the box below.

── System Info ────────────────────────────────────────────────────────────
• R version 4.3.1 (2023-06-16 ucrt) • Running under: Windows 11 x64 (build 22621)
── Package Status ─────────────────────────────────────────────────────────
• ffscrapr (1.4.8.03)
── Package Options ────────────────────────────────────────────────────────
No options set for above packages
── Package Dependencies ───────────────────────────────────────────────────
• askpass    (1.1)     • glue      (1.6.2)     • rappdirs   (0.3.3)   
• assertthat (0.2.1)   • httr      (1.4.6)     • ratelimitr (0.4.1)   
• backports  (1.4.1)   • jsonlite  (1.8.7)     • rlang      (1.1.1)   
• cachem     (1.0.8)   • lifecycle (1.0.3)     • stringi    (1.7.12)  
• checkmate  (2.2.0)   • magrittr  (2.0.3)     • stringr    (1.5.0)   
• cli        (3.6.1)   • memoise   (2.0.1)     • sys        (3.4.2)   
• cpp11      (0.4.5)   • mime      (0.12)      • tibble     (3.2.1)   
• curl       (5.0.1)   • nflreadr  (1.3.2.09)  • tidyr      (1.3.0)   
• data.table (1.14.8)  • openssl   (2.1.0)     • tidyselect (1.2.0)   
• dplyr      (1.1.2)   • pillar    (1.9.0)     • utf8       (1.2.3)   
• fansi      (1.0.4)   • pkgconfig (2.0.3)     • vctrs      (0.6.3)   
• fastmap    (1.1.1)   • purrr     (1.0.1)     • withr      (2.5.0)   
• generics   (0.1.3)   • R6        (2.5.1)       
── Not Installed ──────────────────────────────────────────────────────────
• ffsimulator  • ffpros  • ffopportunity  
tanho63 commented 1 year ago

Hmm. Neither mfl_players nor mfl_playerscores returns week-specific teams. I’m reluctant to introduce an external source for a function that is otherwise fully self-contained to what’s in the MFL API (introduces more failure points).

Going to mark this as a wontfix, to resolve I would recommend using load_rosters_weekly to override the teams in question