Closed tetraf closed 10 years ago
Hi. I finally implemented something which will allow you to do what you want (and many more!). This is a new "rewrite" datasource which allow to modify or create fields based on movies data (or not). This new feature use a Python expression to do its job.
Here is an example of configuration to do what you want with collections:
datasource 'rewrite' {
rewrite 'collection_name' {
value = "sub('(?i) collection$', '', movie.get('collection')) if 'collection' in movie else None"
}
}
You can also replace 'collection_name' by 'collection' to rewrite the field instead of creating a new one. You can check the result with the show command.
Don't forget to do a python setup.py egg_info
before to try (to register the new datasource).
Wow, great. Thanks.
With config:
The result:
We could imagine a new config syntax:
Which give: