On 5/3/2013 4:36 PM, Matt C wrote:
> I have one follow-up question. With the site-specific metadata it
> overrides the global replace_metadata (i.e., I have '
> ships=>^Sam/Dean=>Dean Winchester/Sam Winchester', but it remains as
> Sam/Dean for
sinful-desire.org).
>
> I can't seem to find a way around this -- is there one?
There is! It's a relatively new feature. Now ini params can be
extended by using the "add_to_" version.
What happens is that the most 'specific' section is used for
replace_metadata. In ascending order: defaults, www.site, site, epub,
www.site:epub, site:epub, overrides.
But then it goes back through the list of sections in reverse order
looking for add_to_replace_metadata and appends them.
So if you have something like this:
[defaults]
add_to_replace_metadata:
ships=>^Sam/Dean=>Dean Winchester/Sam Winchester
[
www.sinful-desire.org]
...
replace_metadata:
mygenre=>^.*?(|Alternate Universe|Fantasy|Crossover)$=>\1
myships=>^.*?(|Sam/Dean|Chloe B. & J. Rizzoli)$=>\1
mycategory=>^.*?(|Supernatural|Harry Potter)$=>\1
The final effect is the same as if you had:
replace_metadata:
mygenre=>^.*?(|Alternate Universe|Fantasy|Crossover)$=>\1
myships=>^.*?(|Sam/Dean|Chloe B. & J. Rizzoli)$=>\1
mycategory=>^.*?(|Supernatural|Harry Potter)$=>\1
ships=>^Sam/Dean=>Dean Winchester/Sam Winchester
OTOH, if you used add_to_replace_metadata for both sections, you'd end
up with:
replace_metadata:
ships=>^Sam/Dean=>Dean Winchester/Sam Winchester
mygenre=>^.*?(|Alternate Universe|Fantasy|Crossover)$=>\1
myships=>^.*?(|Sam/Dean|Chloe B. & J. Rizzoli)$=>\1
mycategory=>^.*?(|Supernatural|Harry Potter)$=>\1
...which will behave differently if you're changing the same metadata.
However, now that I look at it, I bet this doesn't solve your problem if
you put myships directly into the calibre column. You'd need to add the
Sam/Dean=>Dean Winchester/Sam Winchester line to a specific myships
replacement.
Alternatively, a couple ideas I haven't tried that might work:
Adding myships to the defaults edit, too:
[defaults]
add_to_replace_metadata:
ships,myships=>^Sam/Dean=>Dean Winchester/Sam Winchester
Or possibly including myships in ships:
[
www.sinful-desire.org]
include_in_ships:myships
...and setting the column from ships.