Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-19-2011, 11:18 AM   #1
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
Question automated Tiitle Sort generation

Hi everybody,

I'm new in calibre World, and i test it for adding some books into my iPad.

When i'm add books record calibre fill the "sort Title" like the title but i would use my own rule for filling this. In French language we use some accents and i want to replace with the letter alone ( without accent ) and remove the leading article and send to the end of the title enclose in parenthesis.

eg -> Le peuple de la forêt -> Peuple de la foret (Le)

I think i must write a plugging to obtain that and i can write it, but i'm juste want to know which fontion i must overload to execute something on the blue arrow following the Title in metadata dialogue box.

The Second thing is how to process the whole collection to show where is error in generation ?

The Third thing is how to colored the sort title in green if the sort title is correct with my rule ?
Thanks in advance

Regards from France

Khan-Dam

Last edited by Khan-Dam; 07-19-2011 at 11:22 AM.
Khan-Dam is offline   Reply With Quote
Old 07-19-2011, 11:48 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Khan-Dam View Post
eg -> Le peuple de la forêt -> Peuple de la foret (Le)

I think i must write a plugging to obtain that and i can write it, but i'm juste want to know which fontion i must overload to execute something on the blue arrow following the Title in metadata dialogue box.
As you mention writing a plugin, I am assuming that you can program in python.

You won't be able to do what you want with a plugin. Instead, you want to replace calibre's title_sort function with one of your own. Get the source (see http://manual.calibre-ebook.com/develop.html), the go to src.calibre.ebooks.metadata.__init__. Find the title_sort function and replace it with one that does what you want. You will need to propagate your change to new releases, but that isn't hard to do using bzr shelve.
Quote:
The Second thing is how to process the whole collection to show where is error in generation ?
You would use bulk metadata edit, checking the "update title sort" checkbox.
Quote:
The Third thing is how to colored the sort title in green if the sort title is correct with my rule ?
If you change the source, then the red/green marking will change to respect your rules.
chaley is offline   Reply With Quote
Advert
Old 07-19-2011, 12:14 PM   #3
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
I never write somthing in python, but i not seem's so hard ( i had a long expriance in c++ and Java ! )

Ok i undderstand what you mean in the 1 point, i look for these asap

for the seconf point i don't undersatand what you mean. I thik the bulk metadata is to change the meta data in thes point i just want to make a list with the title sort differ fro the rule not to change them.

for the 3 point it's ok.

just for the fun it's possible to make dialog form to activate or not the change i made in the sort title function ? in this case i bypass my write to call the original fubction ?

Thanks for your rapid answer

Khan-dam
Khan-Dam is offline   Reply With Quote
Old 07-19-2011, 12:20 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Khan-Dam View Post
for the seconf point i don't undersatand what you mean. I thik the bulk metadata is to change the meta data in thes point i just want to make a list with the title sort differ fro the rule not to change them.
The quality check plugin already does this. I thought you wanted to set all the title sorts to the value your new function would return.
Quote:
just for the fun it's possible to make dialog form to activate or not the change i made in the sort title function ? in this case i bypass my write to call the original fubction ?
You can do this with some work. You would use something like function variables in C, something python makes very easy. Change title_sort from a function to a variable. Then add a dialog box (somewhere) that lets you assign a function to that variable. The users of title_sort (and there are many) would use the function that you assign. You would of course need to have a default, probably the current (original) title sort function.
chaley is offline   Reply With Quote
Old 07-19-2011, 01:07 PM   #5
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
thanks a lot for the time you spend for me, i realy apreciate.

I begin to work on this feature asap

Regards

Khan-dam
Khan-Dam is offline   Reply With Quote
Advert
Old 07-31-2011, 03:23 PM   #6
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
next here : https://www.mobileread.com/forums/sho...d.php?t=144900

thanks
Khan-Dam is offline   Reply With Quote
Reply

Tags
french, meta-data, plug-ins


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firmware Update Automated update just applied Dibblah Amazon Kindle 26 09-15-2010 02:07 AM
Unutterably Silly When automated suggestions go bad... Ingrid Lounge 4 09-25-2009 04:06 AM
Seriously thoughtful Book, Version 1.0, Automated Jack Tingle Lounge 6 04-10-2009 10:41 PM


All times are GMT -4. The time now is 04:55 PM.


MobileRead.com is a privately owned, operated and funded community.