Skip to content

Commit

Permalink
Merge pull request #59 from mpadge/master
Browse files Browse the repository at this point in the history
fix getDepositionByConceptDOI method
  • Loading branch information
eblondel authored Oct 11, 2021
2 parents 969053a + 7c81612 commit a774850
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 a774850

Please sign in to comment.