diff --git a/NAMESPACE b/NAMESPACE index e69f377..b51e818 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,6 +5,9 @@ S3method(tidy,playlist) export(add_tracks_to_playlist) export(change_playlist_details) export(check_me_following) +export(check_my_saved_albums) +export(check_my_saved_shows) +export(check_my_saved_tracks) export(check_users_following) export(create_playlist) export(dedupe_album_names) @@ -34,6 +37,7 @@ export(get_my_playlists) export(get_my_profile) export(get_my_recently_played) export(get_my_saved_albums) +export(get_my_saved_shows) export(get_my_saved_tracks) export(get_my_top_artists_or_tracks) export(get_new_releases) @@ -56,7 +60,13 @@ export(get_user_profile) export(is_uri) export(pause_my_playback) export(pitch_class_lookup) +export(remove_my_saved_albums) +export(remove_my_saved_shows) +export(remove_my_saved_tracks) export(remove_tracks_from_playlist) +export(save_albums_to_library) +export(save_shows_to_library) +export(save_tracks_to_library) export(scopes) export(search_spotify) export(seek_to_position) diff --git a/R/library.R b/R/library.R index 660a556..fa8a959 100644 --- a/R/library.R +++ b/R/library.R @@ -1,3 +1,73 @@ +#' Check User's Saved Albums +#' +#'Check if one or more albums is already saved in the current Spotify user’s ‘Your Music’ library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @return +#' Returns a data frame of results containing album id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +#' @export + +check_my_saved_albums <- function(ids, authorization = get_spotify_authorization_code()) { + base_url = 'https://api.spotify.com/v1/me/albums/contains' + params <- list(ids = ids) + # params <- ids + res <- RETRY('GET', base_url, query = params, config(token = authorization), encode = 'json') + stop_for_status(res) + res <- fromJSON(content(res, as = 'text', encoding = 'UTF-8'), flatten = TRUE) + + tibble(album_id = ids, + is_saved = res) +} +#' Check User's Saved Shows +#' +#'Check if one or more shows is already saved in the current Spotify user’s library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @return +#' Returns a data frame of results containing show id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +#' @export + +check_my_saved_shows <- function(ids, authorization = get_spotify_authorization_code()) { + base_url = 'https://api.spotify.com/v1/me/shows/contains' + params <- list(ids = ids) + # params <- ids + res <- RETRY('GET', base_url, query = params, config(token = authorization), encode = 'json') + stop_for_status(res) + res <- fromJSON(content(res, as = 'text', encoding = 'UTF-8'), flatten = TRUE) + + tibble(album_id = ids, + is_saved = res) +} +#' Check User's Saved Tracks +#' +#'Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @return +#' Returns a data frame of results containing track id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +#' @export + +check_my_saved_tracks <- function(ids, authorization = get_spotify_authorization_code()) { + base_url = 'https://api.spotify.com/v1/me/tracks/contains' + params <- list(ids = ids) + # params <- ids + res <- RETRY('GET', base_url, query = params, config(token = authorization), encode = 'json') + stop_for_status(res) + res <- fromJSON(content(res, as = 'text', encoding = 'UTF-8'), flatten = TRUE) + + tibble(album_id = ids, + is_saved = res) +} + #' Get Current User's Saved Albums #' #' Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library. @@ -12,10 +82,12 @@ #' Default: 0 (the first object). Maximum offset: 100,000. Use with \code{limit} to get the next set of albums. #' @param market Optional. \cr #' An \href{http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2}{ISO 3166-1 alpha-2 country code} or the string \code{"from_token"}. Provide this parameter if you want to apply \href{https://developer.spotify.com/documentation/general/guides/track-relinking-guide/}{Track Relinking} -#' @param authorization Required. A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. -#' @param include_meta_info Optional. Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}. +#' @param authorization Required.\cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param include_meta_info Optional.\cr +#' Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}. #' @return -#' Returns a data frame of results containing user profile information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-albums/} for more information. +#' Returns a data frame of results containing user saved albums information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-albums/} for more information. #' @export get_my_saved_albums <- function(limit = 20, offset = 0, market = NULL, authorization = get_spotify_authorization_code(), include_meta_info = FALSE) { @@ -40,6 +112,43 @@ get_my_saved_albums <- function(limit = 20, offset = 0, market = NULL, authoriza return(res) } +#' Get User's Saved Shows +#' +#' Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned. +#' +#' @param limit Optional. \cr +#' Maximum number of shows to return. \cr +#' Default: 20 \cr +#' Minimum: 1 \cr +#' Maximum: 50 \cr +#' @param offset Optional. \cr +#' The index of the first show to return. \cr +#' Default: 0 (the first object). Use with \code{limit} to get the next set of shows. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param include_meta_info Optional. \cr +#' Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}. +#' +#' @return +#' Returns a data frame of results containing saved shows information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-shows/} for more information. +#' @export + +get_my_saved_shows <- function(limit = 20, offset = 0, authorization = get_spotify_authorization_code(), include_meta_info = FALSE) { + base_url <- 'https://api.spotify.com/v1/me/shows' + params <- list( + limit = limit, + offset = offset + ) + res <- RETRY('GET', base_url, query = params, config(token = authorization), encode = 'json') + stop_for_status(res) + res <- fromJSON(content(res, as = 'text', encoding = 'UTF-8'), flatten = TRUE) + + if(!include_meta_info) { + res <- res$items + } + return(res) +} + #' Get a User's Saved Tracks #' #'Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library. @@ -54,10 +163,12 @@ get_my_saved_albums <- function(limit = 20, offset = 0, market = NULL, authoriza #' Default: 0 (the first object). Maximum offset: 100,000. Use with \code{limit} to get the next set of tracks. #' @param market Optional. \cr #' An \href{http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2}{ISO 3166-1 alpha-2 country code} or the string \code{"from_token"}. Provide this parameter if you want to apply \href{https://developer.spotify.com/documentation/general/guides/track-relinking-guide/}{Track Relinking} -#' @param authorization Required. A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. -#' @param include_meta_info Optional. Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param include_meta_info Optional. \cr +#' Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}. #' @return -#' Returns a data frame of results containing user profile information. See \url{https://developer.spotify.com/documentation/web-api/reference/users-profile/get-current-users-profile/} for more information. +#' Returns a data frame of results containing user saved tracks information. See \url{https://developer.spotify.com/documentation/web-api/reference/users-profile/get-users-saved-tracks/} for more information. #' @export get_my_saved_tracks <- function(limit = 20, offset = 0, market = NULL, authorization = get_spotify_authorization_code(), include_meta_info = FALSE) { @@ -81,3 +192,172 @@ get_my_saved_tracks <- function(limit = 20, offset = 0, market = NULL, authoriza } return(res) } + +#' Remove Albums for Current User +#' +#' Remove one or more albums from the current user’s ‘Your Music’ library. \cr +#' Changes to a user’s saved albums may not be visible in other Spotify applications immediately. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +remove_my_saved_albums <- function(ids, authorization = get_spotify_authorization_code(), echo =FALSE) { + base_url <- 'https://api.spotify.com/v1/me/albums' + + params <- toJSON(ids) + + res <- RETRY('DELETE', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} + +#' Remove User's Saved Shows +#' +#' Delete one or more shows from current Spotify user’s library.\cr +#' Changes to a user’s saved shows may not be visible in other Spotify applications immediately. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +remove_my_saved_shows <- function(ids, authorization = get_spotify_authorization_code(), echo =FALSE) { + base_url <- 'https://api.spotify.com/v1/me/shows' + + params <- toJSON(ids) + + res <- RETRY('DELETE', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} + +#' Remove User's Saved Tracks +#' +#' Remove one or more tracks from the current user’s ‘Your Music’ library. \cr +#' Changes to a user’s saved tracks may not be visible in other Spotify applications immediately. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +remove_my_saved_tracks <- function(ids, authorization = get_spotify_authorization_code(), echo =FALSE) { + base_url <- 'https://api.spotify.com/v1/me/tracks' + + params <- toJSON(ids) + + res <- RETRY('DELETE', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} + + +#' Save Albums for Current User +#' +#' Save one or more albums to the current user’s ‘Your Music’ library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +save_albums_to_library <- function(ids, authorization = get_spotify_authorization_code(), echo = FALSE){ + base_url <- 'https://api.spotify.com/v1/me/albums' + + params <- toJSON(ids) + res <- RETRY('PUT', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} + +#' Save Shows for Current User +#' +#' Save one or more shows to current Spotify user’s library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +save_shows_to_library <- function(ids, authorization = get_spotify_authorization_code(), echo = FALSE){ + base_url <- 'https://api.spotify.com/v1/me/shows' + + params <- toJSON(ids) + res <- RETRY('PUT', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} + +#' Save Tracks for Current User +#' +#' Save Tracks for User Save one or more tracks to the current user’s ‘Your Music’ library. +#' +#' @param ids Required. \cr +#' A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs. +#' @param authorization Required. \cr +#' A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user. +#' @param echo Optional.\cr +#' Boolean indicating whether to return the response or work silently. +#' +#' @return +#' Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +#' @export + +save_tracks_to_library <- function(ids, authorization = get_spotify_authorization_code(), echo = FALSE){ + base_url <- 'https://api.spotify.com/v1/me/tracks' + + params <- toJSON(ids) + res <- RETRY('PUT', base_url, body = params, config(token = authorization), encode = 'json') + stop_for_status(res) + + if (echo) { + return(res) + } +} diff --git a/man/check_my_saved_albums.Rd b/man/check_my_saved_albums.Rd new file mode 100644 index 0000000..44babaa --- /dev/null +++ b/man/check_my_saved_albums.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{check_my_saved_albums} +\alias{check_my_saved_albums} +\title{Check User's Saved Albums} +\usage{ +check_my_saved_albums(ids, authorization = get_spotify_authorization_code()) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} +} +\value{ +Returns a data frame of results containing album id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +} +\description{ +Check if one or more albums is already saved in the current Spotify user’s ‘Your Music’ library. +} diff --git a/man/check_my_saved_shows.Rd b/man/check_my_saved_shows.Rd new file mode 100644 index 0000000..355b7d3 --- /dev/null +++ b/man/check_my_saved_shows.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{check_my_saved_shows} +\alias{check_my_saved_shows} +\title{Check User's Saved Shows} +\usage{ +check_my_saved_shows(ids, authorization = get_spotify_authorization_code()) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} +} +\value{ +Returns a data frame of results containing show id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +} +\description{ +Check if one or more shows is already saved in the current Spotify user’s library. +} diff --git a/man/check_my_saved_tracks.Rd b/man/check_my_saved_tracks.Rd new file mode 100644 index 0000000..f5797d8 --- /dev/null +++ b/man/check_my_saved_tracks.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{check_my_saved_tracks} +\alias{check_my_saved_tracks} +\title{Check User's Saved Tracks} +\usage{ +check_my_saved_tracks(ids, authorization = get_spotify_authorization_code()) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} +} +\value{ +Returns a data frame of results containing track id and saved status. See \url{https://developer.spotify.com/documentation/web-api/reference/library/check-users-saved-albums/} for more information. +} +\description{ +Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library. +} diff --git a/man/get_my_saved_albums.Rd b/man/get_my_saved_albums.Rd index e8804c1..7344233 100644 --- a/man/get_my_saved_albums.Rd +++ b/man/get_my_saved_albums.Rd @@ -26,12 +26,14 @@ Default: 0 (the first object). Maximum offset: 100,000. Use with \code{limit} to \item{market}{Optional. \cr An \href{http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2}{ISO 3166-1 alpha-2 country code} or the string \code{"from_token"}. Provide this parameter if you want to apply \href{https://developer.spotify.com/documentation/general/guides/track-relinking-guide/}{Track Relinking}} -\item{authorization}{Required. A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} +\item{authorization}{Required.\cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} -\item{include_meta_info}{Optional. Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}.} +\item{include_meta_info}{Optional.\cr +Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}.} } \value{ -Returns a data frame of results containing user profile information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-albums/} for more information. +Returns a data frame of results containing user saved albums information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-albums/} for more information. } \description{ Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library. diff --git a/man/get_my_saved_shows.Rd b/man/get_my_saved_shows.Rd new file mode 100644 index 0000000..490af31 --- /dev/null +++ b/man/get_my_saved_shows.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{get_my_saved_shows} +\alias{get_my_saved_shows} +\title{Get User's Saved Shows} +\usage{ +get_my_saved_shows( + limit = 20, + offset = 0, + authorization = get_spotify_authorization_code(), + include_meta_info = FALSE +) +} +\arguments{ +\item{limit}{Optional. \cr +Maximum number of shows to return. \cr +Default: 20 \cr +Minimum: 1 \cr +Maximum: 50 \cr} + +\item{offset}{Optional. \cr +The index of the first show to return. \cr +Default: 0 (the first object). Use with \code{limit} to get the next set of shows.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{include_meta_info}{Optional. \cr +Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}.} +} +\value{ +Returns a data frame of results containing saved shows information. See \url{https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-shows/} for more information. +} +\description{ +Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned. +} diff --git a/man/get_my_saved_tracks.Rd b/man/get_my_saved_tracks.Rd index f53e38d..00bc804 100644 --- a/man/get_my_saved_tracks.Rd +++ b/man/get_my_saved_tracks.Rd @@ -26,12 +26,14 @@ Default: 0 (the first object). Maximum offset: 100,000. Use with \code{limit} to \item{market}{Optional. \cr An \href{http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2}{ISO 3166-1 alpha-2 country code} or the string \code{"from_token"}. Provide this parameter if you want to apply \href{https://developer.spotify.com/documentation/general/guides/track-relinking-guide/}{Track Relinking}} -\item{authorization}{Required. A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} -\item{include_meta_info}{Optional. Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}.} +\item{include_meta_info}{Optional. \cr +Boolean indicating whether to include full result, with meta information such as \code{"total"}, and \code{"limit"}. Defaults to \code{FALSE}.} } \value{ -Returns a data frame of results containing user profile information. See \url{https://developer.spotify.com/documentation/web-api/reference/users-profile/get-current-users-profile/} for more information. +Returns a data frame of results containing user saved tracks information. See \url{https://developer.spotify.com/documentation/web-api/reference/users-profile/get-users-saved-tracks/} for more information. } \description{ Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library. diff --git a/man/remove_my_saved_albums.Rd b/man/remove_my_saved_albums.Rd new file mode 100644 index 0000000..e902d3e --- /dev/null +++ b/man/remove_my_saved_albums.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{remove_my_saved_albums} +\alias{remove_my_saved_albums} +\title{Remove Albums for Current User} +\usage{ +remove_my_saved_albums( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Remove one or more albums from the current user’s ‘Your Music’ library. \cr +Changes to a user’s saved albums may not be visible in other Spotify applications immediately. +} diff --git a/man/remove_my_saved_shows.Rd b/man/remove_my_saved_shows.Rd new file mode 100644 index 0000000..c286585 --- /dev/null +++ b/man/remove_my_saved_shows.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{remove_my_saved_shows} +\alias{remove_my_saved_shows} +\title{Remove User's Saved Shows} +\usage{ +remove_my_saved_shows( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Delete one or more shows from current Spotify user’s library.\cr +Changes to a user’s saved shows may not be visible in other Spotify applications immediately. +} diff --git a/man/remove_my_saved_tracks.Rd b/man/remove_my_saved_tracks.Rd new file mode 100644 index 0000000..14f5911 --- /dev/null +++ b/man/remove_my_saved_tracks.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{remove_my_saved_tracks} +\alias{remove_my_saved_tracks} +\title{Remove User's Saved Tracks} +\usage{ +remove_my_saved_tracks( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Remove one or more tracks from the current user’s ‘Your Music’ library. \cr +Changes to a user’s saved tracks may not be visible in other Spotify applications immediately. +} diff --git a/man/save_albums_to_library.Rd b/man/save_albums_to_library.Rd new file mode 100644 index 0000000..c7a5480 --- /dev/null +++ b/man/save_albums_to_library.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{save_albums_to_library} +\alias{save_albums_to_library} +\title{Save Albums for Current User} +\usage{ +save_albums_to_library( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Save one or more albums to the current user’s ‘Your Music’ library. +} diff --git a/man/save_shows_to_library.Rd b/man/save_shows_to_library.Rd new file mode 100644 index 0000000..2726021 --- /dev/null +++ b/man/save_shows_to_library.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{save_shows_to_library} +\alias{save_shows_to_library} +\title{Save Shows for Current User} +\usage{ +save_shows_to_library( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Save one or more shows to current Spotify user’s library. +} diff --git a/man/save_tracks_to_library.Rd b/man/save_tracks_to_library.Rd new file mode 100644 index 0000000..e78c7ba --- /dev/null +++ b/man/save_tracks_to_library.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/library.R +\name{save_tracks_to_library} +\alias{save_tracks_to_library} +\title{Save Tracks for Current User} +\usage{ +save_tracks_to_library( + ids, + authorization = get_spotify_authorization_code(), + echo = FALSE +) +} +\arguments{ +\item{ids}{Required. \cr +A comma-separated list of the \href{https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids}{Spotify IDs} for the albums. Maximum: 50 IDs.} + +\item{authorization}{Required. \cr +A valid access token from the Spotify Accounts service. See the \href{https://developer.spotify.com/documentation/general/guides/authorization-guide/}{Web API authorization Guide} for more details. Defaults to \code{spotifyr::get_spotify_authorization_code()}. The access token must have been issued on behalf of the current user.} + +\item{echo}{Optional.\cr +Boolean indicating whether to return the response or work silently.} +} +\value{ +Returns a respinse status. See \url{https://developer.spotify.com/documentation/web-api/#response-status-codes} for more information. +} +\description{ +Save Tracks for User Save one or more tracks to the current user’s ‘Your Music’ library. +}