10-21-2012, 06:12 PM | #16 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I'd forgotten that searches are case insensitive, so the regexp search doesn't work, sorry.
Getting and setting custom column values is pretty easy: Code:
existing=db.get_custom(book_id,label=label,index_is_id=True) db.set_custom(book_id, value, label=label, commit=True) (added) And, of course, you can use the custom column for the search instead of the regexps. Last edited by JimmXinu; 10-21-2012 at 06:17 PM. |
10-21-2012, 06:39 PM | #17 | |
Connoisseur
Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Quote:
I attach the latest version just in case it is useful to someone else (in the next few days I will try on windows and on my huge collection of about 1000 books). Xwang |
|
10-23-2012, 01:29 PM | #18 |
Connoisseur
Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
I attach the newer version in which I use the string "_T[##]" as a prefix before title and author name, instead of using it at their end (I've thought that since under Windows the folder and file name can be cut with respect to the title inside metadata, it is possible that the special string is washed out creating issues).
This version works well, but their still a problem with the mixed use of linux and windows. The problem is originated by the 256 character windows limit on complete path length. I've discovered that using the plugin under linux, it creates a lot of book with an excessively long path. So I wonder if it is possible to modify the plugin so that to limit the length of file and directory name maintaining the full title in the metadata. Thank you, Xwang Last edited by Xwang; 10-23-2012 at 03:10 PM. |
10-23-2012, 03:45 PM | #19 | |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
But since you're already changing the title/authors, you can do other things. Replace common words/phrases with abbreviations: 'Federal Aviation Administration' with 'FAA', etc. Code:
mi.title = mi.title.replace('Federal Aviation Administration','FAA') Code:
mi.title = mi.title.replace('Federal Aviation Administration','FAA') mi.title = mi.title[:-5][:100] |
|
10-23-2012, 04:01 PM | #20 | |
Connoisseur
Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Quote:
The check on the length of the title should be run every time the "OK" button is pushed on the metadata GUI, so that to avoid the long filename is created at all. Is it possible to link a plugin function to such an action? Otherwise I can create a plugin to scan for the entire library in a manner similar to this one to cut the title if necessary by saving the entire title in the additional db field. Xwang |
|
08-07-2019, 05:09 PM | #21 |
Connoisseur
Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
|
Sorry if I reopen this thread but I've discovered that the plugin is loaded in the newer Calibre version, but there is no possibility to add the button that is needed to run it. I'm missing something?
|
08-07-2019, 06:03 PM | #22 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Your plugin hasn't been through the conversion to Qt5 from several years back. Here's a contemporary thread about it.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to access "database" from a plugin | hakan42 | Development | 2 | 09-06-2012 05:35 PM |
upper case to sentence case conversion | cybmole | Sigil | 8 | 01-20-2011 06:03 AM |
I don't like the way calibre sticks with upper-case/capital | acolsandra | Calibre | 6 | 11-12-2010 11:17 AM |
Update Metadata in database from Plugin | DokaMax | Plugins | 0 | 05-22-2010 05:58 AM |
Upper half of the screen blank | tapf! | Sony Reader | 6 | 07-18-2008 02:49 AM |