View Single Post
Old 01-18-2021, 09:00 PM   #5223
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,990
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Ascello View Post
That's what I tried to use, but for some reason returned me a similarly random list of characters instead of error msg. Although I only tested it with one link, so I need to check it out further, to fully understand what I did wrong. What should the error output look like?


Characters like ABcd or Harry, Ron, Hermione? One sounds like you are assigning Characters to it, the other sounds like you broke something.

Error output is the same as the messages in the View Log when an update/download finishes.

Quote:
Originally Posted by Ascello View Post
Right, so I tried this and I struggle. So, I got some random fics with single category and then wrote this:
Code:
replace_metadata:
 category=>^.*$=>xx
 category=>^xx$=>yy\,zz
I wanted all the fics to end up with two categories: yy and zz. But I only ended up with single xx. What did I do wrong? Here are the fics I tested it with: 1, 2, 3, 4. Again, that is ALL the code I have in personal.ini, so nothing is interacting.
I had to go look at this for a bit too before I understood what's going on.

When you do a \, split, FFF runs each resulting entry back through the replace_metadata again, so when yy & zz hit the first line, they get changed back into xx. But then the infinite recursion check on the second line bails out, leaving xx, xx which dedups to xx.

This is deliberate so that if you have something like:
Code:
replace_metadata:
 freeformtags=>^(.*)/(.*)$=>\1\,\2
 freeformtags=>Bob=>Robert
 freeformtags=>Bill=>William
When fed "Bob/Bill" you get "Robert, William".

I've added a note about that to the wiki page:
https://github.com/JimmXinu/FanFicFa...eplaceMetadata
JimmXinu is offline   Reply With Quote