View Single Post
Old 07-28-2013, 04:21 PM   #1570
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,015
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Linwe View Post
I made a custom column named Fandom that I want to put shorthand or abbreviated categories into. I.E., "Ouran High School Host Club" becomes "OHC", and "How To Train Your Dragon" becomes "HTTYD" and are then loaded into the custom Fandom column.
It's possible, but it's not necessarily simple.

If you want the abbreviations on the title page and in tags as well, you can make the changes to the category entry directly in personal.ini:

Code:
[defaults]
replace_metadata:
 category=>Ouran High School Host Club=>OHC
 category=>How To Train Your Dragon=>HTTYD
Then you can fill your Fandom column from the GUI settings of the FFDL Custom Column tab.

However, if you want only to have the abbreviations in the Fandom column, you need to Allow custom_columns_settings (towards the bottom of the FFDL Custom Column tab) and include something like this in personal.ini:

Code:
[defaults]
# Adds a new 'extra' valid entry
add_to_extra_valid_entries:,fandom

# copy category to fandom
include_in_fandom:category

# replace with abbrevs in fandom
replace_metadata:
 fandom=>Ouran High School Host Club=>OHC
 fandom=>How To Train Your Dragon=>HTTYD

# set custom column with fandom value.
custom_columns_settings:
 fandom=>#fandom
replace_metadata can be quite complex.

Spoiler:
Code:
## Use regular expressions to find and replace (or remove) metadata.
## For example, you could change Sci-Fi=>SF, remove *-Centered tags,
## etc.  See http://docs.python.org/library/re.html (look for re.sub)
## for regexp details.
## Make sure to keep at least one space at the start of each line and
## to escape % to %%, if used.
## Two, three or five part lines.  Two part effect everything.
## Three part effect only those key(s) lists.
## *Five* part lines.  Effect only when trailing conditional key=>regexp matches
## metakey[,metakey]=>pattern=>replacement[&&conditionalkey=>regexp]
## Note that if metakey == conditionalkey the conditional is ignored.
## You can use \s in the replacement to add explicit spaces.  (The config parser
## tends to discard trailing spaces.)
## replace_metadata <entry>_LIST options: FFDL replace_metadata lines
## operate on individual list items for list entries. But if you
## want to do a replacement on the joined string for the whole list,
## you can by using <entry>_LIST. Example, if you added
## calibre_author: calibre_author_LIST=>^(.{,100}).*$=>\1
replace_metadata:
 genre,category=>Sci-Fi=>SF
 Puella Magi Madoka Magica.* => Madoka
 Comedy=>Humor
 Crossover: (.*)=>\1
 title=>(.*)Great(.*)=>\1Moderate\2
 .*-Centered=>
 characters=>Sam W\.=>Sam Witwicky&&category=>Transformers
 characters=>Sam W\.=>Sam Winchester&&category=>Supernatural


There was talk once of some of the users who do tons of data customization sharing their setups, but I don't remember seeing any posted.
JimmXinu is offline