Quote:
Originally Posted by ownedbycats
[...]
In an Action Chain, if I run this once, it produces the standardidentifier and does not delete the url: identifier. If I run it on a book that has both standard and url: identifiers it does delete the url:. Do I need to make it two separate actions/templates?
|
I verified that an Action Chains single field edit will replace the ids with the result of the template. Example: given identifiers of
and the action chain
Spoiler:
Code:
{
"ActionsChainMenus": {
"Menus": [
{
"active": true,
"chain_settings": {
"chain_links": [
{
"action_name": "Single Field Edit",
"action_settings": {
"col_name": "identifiers",
"template": "program:\n\tlist_difference($identifiers, 'ao3:1', ',')",
"value_type": "template"
},
"comment": ""
}
],
"refresh_gui": true
},
"image": "",
"menuText": "Test identifiers",
"subMenu": ""
}
]
},
"schemaVersion": 1.8
}
then the result is
Code:
goodreads:16967, uri:https://archiveofourown/works/12345, x:y
The ao3:1 identifier is removed. I can't say why it doesn't work for you. I suggest you put print() statements in it so you can verify exactly the result of the template.
FWIW: the
Code:
n = re(u, '^^https://standardebooks.org/ebooks/()', '\1');
is strange. The \1 will always result in the empty string because the grouping () contains no pattern, so why is it there? I also don't know why there are two ^ anchors in the front. I think you mean
Code:
n = re(u, '^https://standardebooks.org/ebooks/(.*)$', '\1');