Skip to content

Commit

Permalink
fix getDepositionByConceptDOI method
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Oct 11, 2021
1 parent 969053a commit 7c81612
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/ZenodoManager.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,12 @@ ZenodoManager <- R6Class("ZenodoManager",
query <- sprintf("conceptdoi:%s", gsub("/", "//", conceptdoi))
result <- self$getDepositions(q = query, exact = TRUE)
if(length(result)>0){
result <- result[[1]]
if(result$conceptdoi == conceptdoi){
self$INFO(sprintf("Successfully fetched record for concept DOI '%s'!", conceptdoi))
}else{
dois <- vapply(result, function(i) i$doi, character(1))
if (!conceptdoi %in% dois){
result <- NULL
}else{
result <- result[[which(dois == conceptdoi)[1]]]
self$INFO(sprintf("Successfully fetched record for concept DOI '%s'!", conceptdoi))
}
}else{
result <- NULL
Expand Down

0 comments on commit 7c81612

Please sign in to comment.