Skip to content

Commit

Permalink
Add missing file conversion size parameter for B which created missin…
Browse files Browse the repository at this point in the history
…gs and errors
  • Loading branch information
datapumpernickel committed Sep 19, 2024
1 parent 6f34592 commit 160ce4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/ct_process_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ct_process_response <-
if (bulk) {

if (!dir.exists(tools::R_user_dir('comtradr_bulk',which = 'cache'))) {
dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'), recursive = TRUE)
dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'),
recursive = TRUE)
}
filename <- httr2::resp_header(resp, "Content-Disposition") |>
stringr::str_remove('.*filename="') |>
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ replace_month <- function(date_str) {
#'
#' @noRd
convert_file_size <- function(file_sizes) {
units <- c(KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4)
units <- c(B = 1, KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4)
sapply(file_sizes, function(x) {
parts <- strsplit(x, " ")[[1]]
number <- as.numeric(parts[1])
Expand Down

0 comments on commit 160ce4b

Please sign in to comment.