Skip to content

Commit

Permalink
filename_copy: write "hotfolder_log"
Browse files Browse the repository at this point in the history
see #68386
  • Loading branch information
martinrode committed Apr 15, 2024
1 parent 9ad3929 commit f80198c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/collection/filename_copy/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,24 @@ process.stdin.on('end', () => {
process.exit(1);
}


data.hotfolder_log = []

var modified = false
let col = data?.info?.collection_config?.filename_copy?.filename_target
if (col) {
data.objects.forEach((obj, idx) => {
// set a custom field to the filename of the uploaded file
obj[obj._objecttype][col] = data?.info?.file?.original_filename || "<no filename>"
data.hotfolder_log.push({
"path": "path",
"file": obj[obj._objecttype][col],
"filesize": "filesize",
"status": "done",
"msg": col+" was set by hotfolder plugin",
"asset_id": "123",
"system_object_id": "124"
})
modified = true
})
}
Expand Down

0 comments on commit f80198c

Please sign in to comment.