View Single Post
Old 10-20-2012, 04:14 PM   #948
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.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by Jade Aislin View Post
First I'm trying to use the replace metadata feature to fix a problem that I have had since I started using FFDL. Two different characters from different fandoms use the same name in FFN, Supernatural's Sam W. (Sam Winchester) and Transformers' Sam W. (Sam Witwicky). I was hoping to use the replace metadata so that I don't have to do a manual replace everytime I downloaded a story with either of those characters.
Hmmm. That's not an easy problem. In fact, it can't be done with the existing replace_metadata feature.

Your first problem in all cases is that the section name needs to be [www.fanfiction.net], not [http://www.fanfiction.net/]. With that fixed, both of your latter two examples work.

But even with that, it needs a new feature to make it work. And it's interesting enough I've taken a stab at it.

With the attached version, try this:

Code:
[www.fanfiction.net]

## *Five* part lines.  Effect only when trailing conditional key=>regexp matches
## metakey[,metakey]=>pattern=>replacement[&&metakey=>regexp]
replace_metadata:
 characters=>Sam W\.=>Sam Witwicky&&category=>Transformers
 characters=>Sam W\.=>Sam Winchester&&category=>Supernatural
It's similar to your intuitive first try above, but puts the conditional at the end with a different separator.

This will fail in the face of a Transformers/Supernatural crossover, but I don't see any way around that.

Last edited by JimmXinu; 10-22-2012 at 08:13 PM. Reason: Remove obsolete beta versions
JimmXinu is offline   Reply With Quote