Skip to content

Commit

Permalink
fixing #130, and some RMD Check warnings (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
thieled authored Apr 4, 2024
1 parent 4ccf587 commit 38f1081
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 13 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ BugReports: https://github.com/soodoku/tuber/issues
Depends:
R (>= 3.4.0)
Imports:
askpass,
dplyr,
httpuv,
httr,
httr2,
jsonlite,
magrittr,
mime,
plyr,
purrr,
tibble,
Expand All @@ -41,4 +42,4 @@ VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
6 changes: 3 additions & 3 deletions R/get_playlist_items.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ get_playlist_items <- function(filter = NULL, part = "contentDetails",
max_results = 50, video_id = NULL,
page_token = NULL, simplify = TRUE, ...) {

if (max_results < 0 || max_results > 50) {
stop("max_results must be a value between 0 and 50.")
}
# if (max_results < 0 || max_results > 50) {
# stop("max_results must be a value between 0 and 50.")
# }

valid_filters <- c("item_id", "playlist_id")
if (!(names(filter) %in% valid_filters)) {
Expand Down
18 changes: 10 additions & 8 deletions R/yt_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#' Takes one of three values: \code{'any'} (return all videos; Default),
#' \code{'creativeCommon'} (return videos with Creative Commons
#' license), \code{'youtube'} (return videos with standard YouTube license).
#' @param region_code Character. i18nRegion. Default is NULL.
#' @param relevance_language Character. Default is "en".
#' @param simplify Boolean. Return a data.frame if \code{TRUE}.
#' Default is \code{TRUE}.
#' If \code{TRUE}, it returns a list that carries additional information.
Expand Down Expand Up @@ -136,22 +138,22 @@ yt_search <- function(term = NULL, max_results = 50, channel_id = NULL,
stop("Location radius must be specified with location")
}

querylist <- list(part = "snippet",
q = term,
querylist <- list(part = "snippet",
q = term,
maxResults = max_results,
channelId = channel_id,
channelId = channel_id,
type = type,
channelType = channel_type,
channelType = channel_type,
eventType = event_type,
location = location,
locationRadius = location_radius,
publishedAfter = published_after,
publishedBefore = published_before,
videoDefinition = video_definition,
videoCaption = video_caption,
videoType = video_type,
videoType = video_type,
videoSyndicated = video_syndicated,
videoLicense = video_license,
videoLicense = video_license,
regionCode = region_code,
relevanceLanguage = relevance_language,
pageToken = page_token)
Expand Down Expand Up @@ -180,9 +182,9 @@ yt_search <- function(term = NULL, max_results = 50, channel_id = NULL,

while (is.character(page_token)) {

a_res <- yt_search(part = "snippet",
a_res <- yt_search(part = "snippet",
term = term,
max_results = max_results,
max_results = max_results,
channel_id = channel_id,
type = type,
relevance_language = relevance_language,
Expand Down
9 changes: 9 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Eliminating 'no visible binding' note
utils::globalVariables(c('kind',
'etag',
'items',
'snippet',
'add_headers'

))

19 changes: 19 additions & 0 deletions man/tuber.Rd

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

6 changes: 6 additions & 0 deletions man/yt_search.Rd

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

0 comments on commit 38f1081

Please sign in to comment.