Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-07-2014, 05:33 PM   #1
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 590
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / Bookeen Frontlight / Kobo Mini / Kindle 3 / Nook Color
[GUI Plugin] Clean Metadata

My first plugin...

This plugin edits the metadata of selected books in your library.
You can either just mark the books that will get changed or directly execute the changes.
The main purpose is to mass-update many books at once that have pretty messed up metadata.

Main Features:
  • Cleanup German umlauts in title: "Boser Ueberfall und Duell der Daemonen" => "Boser Überfall und Duell der Dämonen"
  • Cleanup titles: "This is a book title (German Edition)" / "This is a book title. A novel" / "This_is_a_book_title" => "This is a book title"
  • Get series info from titles: "Harry Potter 3: The Prisoner of Azkaban" => title: "The Prisoner of Azkaban", series: "Harry Potter", series_index: 3
  • Cleanup authors: "Lastname, A B.C. Firstname; Anotherlastname, Anotherfirstname" => 1: "A. B. C. Firstname Lastname", 2: "Anotherfirstname Anotherlastname"
  • Swap author and title if title matches an existing author: title: "Stephen King", author: "Cujo" => title: "Cujo", author: "Stephen King" *if* there is already one othebook in your library with author "Stephen King"

Special Notes:
  • Requires Calibre 2.0.0 or later
  • Use at your own risk! Due to some false findings you might create more damage to your metadata than you will repair using this plugin!
  • So far I completely failed to save the settings of the two checkboxes, the interfacedemo plugin was no great help for this. If someone could help me here that would be great, but beware, I'm a complete newbie to Python and Qt5!

Installation Notes:
  1. Download the attached zip file and install the plugin/restart Calibre/add to context menu as described in the Introduction to plugins thread.

Running from command line:
  • not supported

Paypal Donations:
  • nope. I wrote this mainly for myself and don't want to send money to myself!

Version History:

Spoiler:

Version 0.0.6 - 22 Nov 2014
Renamed from "WS64 Cleanup" to "Clean Metadata"

Version 0.0.5 - 20 Nov 2014
New function: Find Duplicate author candidates

Version 0.0.4 - 09 Nov 2014
Bugfixes and minor improvements

Version 0.0.3 - 07 Nov 2014
Initial release. Since just three days ago I have not seen any Python/Qt5 source code the code is far from perfect and probably still very buggy.

Attached Thumbnails
Click image for larger version

Name:	screenshot.jpg
Views:	100
Size:	44.6 KB
ID:	130745  
Attached Files
File Type: zip Clean Metadata.zip (13.4 KB, 1773 views)

Last edited by WS64; 11-22-2014 at 05:09 AM.
WS64 is offline   Reply With Quote
Old 11-07-2014, 06:20 PM   #2
jhowell
Groupie
jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.jhowell never is beset by a damp, drizzly November in his or her soul.
 
jhowell's Avatar
 
Posts: 195
Karma: 59999
Join Date: Nov 2011
Location: Florida
Device: iPad 2, Kinde PW II
Quote:
Originally Posted by WS64 View Post
If someone has an idea how I can remove the "libprs500" from the progressbar window please let me know!
As Kovid mentioned in another thread you need to use setWindowTitle. I tried your plugin and saw the libprs title. I modified main.py to add
Code:
        progress.setWindowTitle("WS64 CleanUp")
just after
Code:
        progress = QProgressDialog("Processing books","Stop" , 0,len(ids) ,self)
and it worked for me.
jhowell is offline   Reply With Quote
 
Advertisement
Old 11-08-2014, 03:35 AM   #3
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 590
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / Bookeen Frontlight / Kobo Mini / Kindle 3 / Nook Color
@jhowell, thanks, worked!
I'm not sure why it didn't when I tried exactly this the first time...
WS64 is offline   Reply With Quote
Old 11-17-2014, 06:32 PM   #4
DaltonST
Developer
DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.DaltonST shines like a glazed doughnut.
 
DaltonST's Avatar
 
Posts: 144
Karma: 8524
Join Date: Aug 2013
Location: Texas
Device: Nexus 7
Umlauts in QuarantineAndScrub: Title Rules Table

Quote:
Originally Posted by WS64 View Post
[*]Cleanup German umlauts in title: "Boser Ueberfall und Duell der Daemonen" => "Boser Überfall und Duell der Dämonen"
@WS64,

If you install the add-on/plug-in QuarantineAndScrub, be sure to add your umlaut word changes to table _title_rules. I would imagine that changing all "ue" and "ae" dipthongs to u's and a's with umlauts would be incorrect, since I noticed that Duell has no umlaut.

The Tag Rules table, _tag_rules, also would need to have entries for Tags that routinely should have an umlaut.


DaltonST
DaltonST is offline   Reply With Quote
Old 11-18-2014, 04:34 AM   #5
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 590
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / Bookeen Frontlight / Kobo Mini / Kindle 3 / Nook Color
Hi DaltonST, thanks for your feedback.
I guess our plugins have similar goals. ;)
However, the installation of your QuarantineAndScrub looks too complicated for me to try it...

You are right of course that I don't change all "ue"s to "ü"s. I use a blacklist to avoid false changings. Still not perfect, but close...
WS64 is offline   Reply With Quote
Old 12-02-2014, 11:52 AM   #6
dijks005
Junior Member
dijks005 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: none
Hi, i am using yr plugin since yesterday. Great plugin!

However using it today i encoutered a problem. The title check is stopping at 61%.

This is the fault report:

calibre, version 2.11.0
FOUT: Niet afgehandelde fout: <b>error</b>:unbalanced parenthesis

calibre 2.11 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.8
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Successfully initialized third party plugins: Anobii Fetcher && Fantastic Fiction && Barnes & Noble && Search The Internet && Quality Check && Find Duplicates && Extract ISBN && Goodreads && BOL_NL && Clean Metadata
Traceback (most recent call last):
File "calibre_plugins.CleanMetadata.main", line 125, in <lambda>
File "calibre_plugins.CleanMetadata.main", line 596, in process_books
File "calibre_plugins.CleanMetadata.main", line 379, in process_titles
File "re.py", line 142, in search
File "re.py", line 244, in _compile
error: unbalanced parenthesis

Is there something i can do?

tks
dijks005 is offline   Reply With Quote
Old 12-02-2014, 12:01 PM   #7
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 590
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / Bookeen Frontlight / Kobo Mini / Kindle 3 / Nook Color
I stumbled upon the same problem the other day. Seems to happen when the author looks something like this: "abc(def" (no closing brackets).
Havn't checked any further so far (no time right now).
But maybe you can check if you find a book like this in your collection and check if the error goes away if you exclude that one.
Of course this is something I have to fix...
WS64 is offline   Reply With Quote
Old 12-02-2014, 01:23 PM   #8
dijks005
Junior Member
dijks005 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: none
OK, i will try to find such one. The plugin stopped at about 60%. How is yr plugin processing, starting at record 1, so i can skipp the first 60% of the database?
dijks005 is offline   Reply With Quote
Old 12-02-2014, 06:01 PM   #9
dijks005
Junior Member
dijks005 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2014
Device: none
Hi, I checked all 10k+ titles and not such an example is present in my database.
dijks005 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] QuarantineAndScrub DaltonST Plugins 59 Yesterday 02:02 PM
[GUI Plugin] EpubMerge JimmXinu Plugins 186 12-16-2014 01:17 PM
[GUI Plugin] Annotations davidfor Plugins 112 12-07-2014 07:52 PM
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 286 10-30-2014 10:25 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 04:10 AM.


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