View Single Post
Old 03-13-2016, 02:23 PM   #1153
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: 7,025
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by rishidiams View Post
...
1 - Occasionally on AO3 someone will list a relationship but not include those characters in the character list.

This is one example I am currently banging my head over:
http://archiveofourown.org/works/6222439

The problem I am having with this is two-fold.
a) In these instances, I want to include those characters in my Characters column in Calibre. I've managed to split the relationship into two separate entries and both appear when I go to the Custom Columns tab, Characters entry and select Relationships, but I can't make them appear when I select Characters instead. Leaving that drop down box empty results in no data appearing at all.
...
b) I wish to have "Tenth Doctor" renamed to The Doctor.Tenth, but it does not work when splitting a relationship.
...
2 - I'd like to remove one category if another one appears. In other words, if the freeformtags include "Alternate Universe.Human", I would like to remove the redundant tag "Alternate Universe" if it also exists.
You should have a leading comma(,) in add_to_extra_valid_entries, otherwise mycharacters will be falsely concatenated with whatever is before it. That, I believe, is why it isn't showing up in your custom column.
Code:
[defaults]
add_to_extra_valid_entries:,mycharacters,mytags,mystatus
You are splitting ships, when I suspect you mean to be splitting mycharacters:
Code:
[defaults]
...
replace_metadata:
 mycharacters=>(.*)[/&](.*)=>\1 \, \2
...
"Tenth Doctor" isn't becoming "The Doctor.Tenth" for you because you are looking for exactly "Tenth Doctor", which isn't going to match " Tenth Doctor " (note spaces added when you did the mycharacters split) or the Doctor part of "Tenth Doctor/Rose Tyler". Instead I suggest limiting it to mycharacters and ships only, and allowing for "The " in front of it so you don't end up with "The The Doctor.Tenth":
Code:
replace_metadata:
 ...
 mycharacters,ships=>(The )?Tenth Doctor=>The Doctor.Tenth
As for freeformtags "Alternate Universe.Human" vs "Alternate Universe", that's tricky. If you wanted to remove "Alternate Universe.Human" in favor of keeping "Alternate Universe" it would be easy. I can't find a AO3 story by searching for such a tag. Can you provide an example?

All changes together:
Spoiler:

Code:
[defaults]
add_to_extra_valid_entries:,mycharacters,mytags,mystatus
include_in_mycharacters:characters,ships

custom_columns_settings:
 mycharacters=>#characters
replace_metadata:
 mycharacters=>(.*)[/&](.*)=>\1 \, \2
 mycharacters,ships=>(The )?Tenth Doctor=>The Doctor.Tenth
JimmXinu is offline   Reply With Quote