View Single Post
Old 08-18-2013, 10:47 PM   #1609
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 JimmXinu View Post
Hmm. That works for custom columns because they are set as a string. Tags are kept as list objects in python. So calibre, when it sees a ',' in a tag entry is changing it to a ';'.

So there isn't an easy way to do it.

There is, however, a complicated way. You can make two copies of category in new entries, modify those, and then replace the original category with the two new ones. It's not intuitive, but because of the order things get included and replaced it does work.
Code:
extra_valid_entries:splitcat1,splitcat2
include_in_splitcat1:category
include_in_splitcat2:category
include_in_category:splitcat1,splitcat2

replace_metadata:
 splitcat1=>Magical Girl Lyrical Nanoha=>Lyrical Nanoha
 splitcat2=>Magical Girl Lyrical Nanoha=>Magical Girl
 splitcat1=>Puella Magi Madoka Magica/魔法少女まどか★マギカ=>Puella Magi Madoka Magica
 splitcat2=>Puella Magi Madoka Magica/魔法少女まどか★マギカ=>魔法少女まどか★マギカ
Ugly, but that should work for what I want. I have only seen a couple that I wanted to do this wit, o it won't be a problem. Of course, the programmer in me says to find the code and change it

On a separate note, have you considered dynamically loading the adapters from a directory? I was playing with one, and each time I made a change, I had to restart calibre. It occurred to me that loading adapters at runtime would make that a lot easier. I had a very brief look at it, and I know it isn't that simple. But, I just remembered that the Annotations plugin is doing this, so that might serve as an example.
davidfor is offline