View Single Post
Old 06-08-2014, 10:28 PM   #2867
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Amalthia View Post
Thank you! this worked.

A semi-related question is there a way to say add an extra tag only if it detects the other tags are in use.

For example, some authors use Captain America (Movies) but they don't add Marvel Cinematic Universe tag to their story, as a result my Marvel tag cannot be applied to the story until I edit the meta data. I'd like to add the Marvel tag to only the marvel fandoms. I can't just add Marvel to my extratags because I'm downloading fic in other fandoms.
You can use the same test in the replace_metadata more than once. You could try something like:

Code:
replace_metadata:
 fandoms=>Thor \(Movies\)=>Thor
 fandoms=>Thor \(Movies\)=>Marvel Cinematic Universe
 fandoms=>Captain America \(Movies\)=>Captain America 
 fandoms=>Captain America \(Movies\)=>Marvel Cinematic Universe
Another way to do this is:
Code:
replace_metadata:
 fandoms=>Thor \(Movies\)=>Thor
 fandoms=>Captain America \(Movies\)=>Captain America 
 fandoms=>(Thor|Captain America|Iron Man) \(Movies\)=>Marvel Cinematic Universe
The match is done using a regular expression. That makes the matching very powerful.

The thing that I fell is missing for this is being able to supply more that one tag. There have been a couple of times where what I really wanted was to split the found tag into two. The solution was to put two lines in, but it does mean I have two copies of the same match string to maintain if things change.
davidfor is offline