View Single Post
Old 10-19-2012, 11:47 AM   #3
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: 6,399
Karma: 3966377
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
That doesn't stop Xwang from writing one for his own use, though.

First, Xwang, have you proven that changing the author/title to uppercase like that solves your problem? You tried it manually with a smaller set of books, that is?

Assuming so, I suggest a UI plugin that searches for titles/authors with lower case and updates the metadata on command.

One place you could start is with the Extract ISBN plugin. It's the simplest plugin I know of that modifies metadata. You don't need the whole background processing part, but the technique used to update isbn can probably be adapted to update title/authors instead.

Another possible way to do it is this:

Code:
db = self.gui.current_db
bookids = db.search_getting_ids('title:"~[a-z]" or author:"~[a-z]"', None)

for bookid in bookids:
   mi = db.get_metadata(bookid,index_is_id=True)
   mi.title = mi.title.upper()
   auths=[]
   for auth in mi.authors:
      auths.append(auth.upper())
   mi.authors = auths
   db.set_metadata(bookid,mi)

db.refresh_ids(bookids)
I haven't tested it, so I doubt it would work exactly as is, but it's a starting point.
JimmXinu is offline   Reply With Quote