Skip to content

Commit

Permalink
Merge pull request #203 from dynastyprocess/mflstarters-fix
Browse files Browse the repository at this point in the history
fix mfl starters bugs
  • Loading branch information
tanho63 committed Feb 13, 2021
2 parents 609699d + a59e294 commit bc7982f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: ffscrapr
Title: API Client for Fantasy Football League Platforms
Version: 1.2.2.12
Version: 1.2.2.13
Authors@R:
c(person(given = "Tan",
family = "Ho",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Fixed bug in MFL's `ff_playerscores()` function so that it correctly pulls older names. (#196, thanks for reporting Mike!) (v1.2.2.11)
- Actually export `dp_cleannames()` and add it to the NAMESPACE so it's accessible to the end user, whoops.
- Refactored all tests to move test cache files to a separate/non-package location (https://github.com/dynastyprocess/ffscrapr-tests) - so that it is not included in CRAN's package sizing (v1.2.2.12)
- Fixed bugs in MFL's `ff_starters()` function - bad default arg


# ffscrapr 1.2.2
Expand Down
5 changes: 1 addition & 4 deletions R/espn_league.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
#'
#' @examples
#' \donttest{
#' conn <- espn_connect(
#' season = 2020,
#' league_id = 899513
#' )
#' conn <- espn_connect(season = 2020, league_id = 899513)
#' ff_league(conn)
#' }
#'
Expand Down
8 changes: 4 additions & 4 deletions R/mfl_starters.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
#' @examples
#' \donttest{
#' dlf_conn <- mfl_connect(2020, league_id = 37920)
#' ff_starters(conn = dlf_conn, week = 1:2)
#' ff_starters(conn = dlf_conn)
#' }
#'
#' @export
ff_starters.mfl_conn <- function(conn, week = "all", season = NULL, ...) {
ff_starters.mfl_conn <- function(conn, week = 1:17, season = NULL, ...) {
if (is.null(season)) season <- conn$season

checkmate::assert_numeric(week, lower = 1, upper = 21)
checkmate::assert_number(week, lower = 1, upper = 21)
checkmate::assert_number(season)

players_endpoint <- sleeper_players() %>%
players_endpoint <- mfl_players() %>%
dplyr::select("player_id", "player_name", "pos", "team")

franchises_endpoint <- ff_franchises(conn) %>%
Expand Down
5 changes: 1 addition & 4 deletions man/ff_league.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ff_starters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc7982f

Please sign in to comment.