Skip to content

Commit

Permalink
#65 better version handling in get_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 23, 2021
1 parent adc72af commit 581de5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/ZenodoRecord.R
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,14 @@ ZenodoRecord <- R6Class("ZenodoRecord",
return(data.frame(
created = as.POSIXct(version$created, format = "%Y-%m-%dT%H:%M:%OS"),
date = as.Date(version$metadata$publication_date),
version = 0L,
version = if(!is.null(version$metadata$version)) version$metadata$version else NA,
doi = version$doi,
stringsAsFactors = FALSE
))
}))
versions <- versions[order(versions$created),]
row.names(versions) <- 1:nrow(versions)
versions$version <- 1:nrow(versions)
if(all(is.na(versions$version))) versions$version <- 1:nrow(versions)
}
Sys.setlocale("LC_TIME", locale)

Expand Down

0 comments on commit 581de5b

Please sign in to comment.