View Single Post
Old 10-21-2012, 06:02 PM   #15
Xwang
Connoisseur
Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.Xwang ought to be getting tired of karma fortunes by now.
 
Posts: 77
Karma: 2136220
Join Date: Sep 2012
Device: none
Quote:
Originally Posted by JimmXinu View Post
In addition to mi.title and mi.authors, try doing the upper steps on mi.title_sort and mi.author_sort? That might do it.

As for authors with more than one book, there's also some author metadata kept outside the books. You might something like this in addition to (or instead of) setting the authors on each book's mi object.

Code:
autid=db.get_author_id(authorname)
db.rename_author(autid, authorname.upper())
Well, I don't know how to thank you for your help.
I've done as you suggested and now the db is correctly upped cased.
I attach the latest version of the plugin in case you would like to have a look at it.
The only issue opened at the moment is that it continues to rename all the db if I run it twice.
To solve this issue maybe I can add an additional boolean field in the db and when a book is upper cased by the plugin, the additional value is put to yes.
The logic of the plugin should be modified to look at that value and modify a book only if its additional value is not set to yes.
I've already added the additional field in my test db with the name 'is_upper_case_db' which will be yes only if the book has already been upper cased.
The question is "how can I look for that variable to understand if I have to upper case the book?"

Xwang
Attached Files
File Type: zip Upperize_DB.zip (11.7 KB, 665 views)
Xwang is offline   Reply With Quote