Skip to contents

Get a user's collected shows or movies

Usage

user_collection(
  user = getOption("trakt_username"),
  type = c("shows", "movies"),
  unnest_episodes = FALSE,
  extended = c("min", "full")
)

Source

user_collection() wraps endpoint users/:id/collection/:type.

Arguments

user

character(1): Target username (or slug). Defaults to getOption("trakt_username"). Can also be of length greater than 1, in which case the function is called on all user values separately and the result is combined.

type

character(1): Either "shows" or "movies". For season/episode-specific functions, values seasons or episodes are also allowed.

unnest_episodes

logical(1) [FALSE]: Unnests episode data using tidyr::unnest() and returns one row per episode rather than one row per show.

extended

character(1): Either "min" (API default) or "full". The latter returns more variables and should generally only be used if required. See vignette("finding-things") for more details.

Value

A tibble(). If the function has a limit parameter (defaulting to 10), this will be the (maximum) number of rows of the tibble. If there are no results (or the API is unreachable), an empty tibble() is returned.

Details

This function wraps the API method /users/:user_id/collection/:type.

Note

The extended = "metadata" API parameter is not implemented. This would add media information media_type, resolution, audio, audio_channels and 3D to the output, which may or may not be available. If this feature is important to you, please open an issue on GitHub.

Examples

if (FALSE) { # \dontrun{
user_collection(user = "sean", type = "movies")
user_collection(user = "sean", type = "shows")
} # }