Quote:
Originally Posted by JimmXinu
I've arbitrarily chosen '{{,}}' as a separator to indicate to split the replacement string at that point(s) into a list and append the new entries to the end of the list. Because they go to the end, they will in turn have replace_metadata applied.
There's a risk of infinite recursion, that I haven't thought about very deeply yet.
If you're curious, here's my test case:
Spoiler:
Story URL test1.com?sid=1001 and setting default to Update Calibre Only speeds testing considerable.
Code:
[test1.com]
replace_metadata:
category=>Marvel Cinematic Universe=>Marvel Cinematic MultiVerse
category=>Thor \(Movies\)=>Thor{{,}}Marvel Cinematic Universe
genre=>Action=>MovieAction&&category=>MultiVerse
[teststory:1001]
add_to_category_list:Thor (Movies)
add_to_genre_list:Action
chaptertitles:Prologue,Chapter 1\, Xenos on Cinnabar,Chapter 2\, Sinmay on Kintikin,3. Chapter 3,Chapter 4,Chapter 5,Chapter 6,Chapter 7,Chapter 8
Yields:
Category: Marvel Cinematic MultiVerse, Thor
Genre: MovieAction
|
I've been testing this and while introducing cycles doesn't cause infinite loops, the behavior isn't easily predicted.
But for straightforward cases, it seems to work as intended.
The attached version moves the in/exclude_metadata_post checks after the '{{,}}' splitting.