diff --git a/inst/actions/zen4R_deposit_record.R b/inst/actions/zen4R_deposit_record.R
index 5bbe916..3774bd0 100644
--- a/inst/actions/zen4R_deposit_record.R
+++ b/inst/actions/zen4R_deposit_record.R
@@ -117,6 +117,17 @@ function(action, entity, config){
update <- TRUE
record_status <- zenodo_metadata$status
+ if(length(zenodo_metadata$getVersions())>0){
+ #to know if the record has been already published, we check if there is at least one version set
+ #the property "is_published" is transient to the record and can't be used
+ if(!depositWithFiles){
+ #the first run of the action will be skipped and we will wait for the final generic_uploader run
+ #with depositWithFiles=TRUE to run the version to avoid two versions to be created
+ config$logger.info(sprintf("Zenodo: record '%s' already published. Skip 1st run to create version with generic uploader at the end of the workflow", zenodo_metadata$id))
+ return(TRUE)
+ }
+ }
+
#case of published records and 'edition' strategy, need to unlock record
if(record_status == "published" &&
zenodo_metadata$is_published &&
@@ -129,17 +140,6 @@ function(action, entity, config){
}
}
- if(length(zenodo_metadata$getVersions())>0 && strategy == "newversion"){
- #to know if the record has been already published, we check if there is at least one version set
- #the property "is_published" is transient to the record and can't be used
- if(!depositWithFiles){
- #the first run of the action will be skipped and we will wait for the final generic_uploader run
- #with depositWithFiles=TRUE to run the version to avoid two versions to be created
- config$logger.info(sprintf("Zenodo: record '%s' already published. Skip 1st run to create version with generic uploader at the end of the workflow", zenodo_metadata$id))
- return(TRUE)
- }
- }
-
if(record_status == "new_version_draft"){
config$logger.info("Draft version already set. Discard initial changes before publishing new version...")
ZENODO$discardChanges(zenodo_metadata$id)
@@ -174,6 +174,7 @@ function(action, entity, config){
config$logger.info("Setting Zenodo record metadata properties")
}
#language
+ zenodo_metadata$metadata$languages = list()
if(!is.null(entity$language)){
zenodo_metadata$addLanguage(entity$language)
}
@@ -182,11 +183,28 @@ function(action, entity, config){
if(!is.null(entity$titles[["alternative"]])){
zenodo_metadata$addAdditionalTitle(entity$titles[["alternative"]], type = "alternative-title")
}
+ zenodo_metadata$metadata$additional_descriptions = list()
abstract = gsub("\n", "
", entity$descriptions[["abstract"]])
zenodo_metadata$setDescription(abstract)
if(!is.null(entity$descriptions[["info"]])){
zenodo_metadata$addAdditionalDescription(entity$descriptions[["info"]], type = "technical-info")
}
+ if(!is.null(entity$provenance)){
+ prov = paste0("
", gsub("\n", "
", entity$provenance$statement), "