Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2014, 01:41 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: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Author/Title sort

I wrote a little plugin that reads the metadata of books using self.db.get_metadata, then changes the values of the author and/or the title and writes the data back using self.db.set_metadata.
Everything works.
What I don't get to work, how do I set author_sort and/or title_sort of my changed values? Is there a function that I can use to calculate and write them back?

One more question, I also use QProgressDialog, it works, but it always shows "libprs500" in the header of the progress window. How do i get rid of this?
WS64 is offline   Reply With Quote
Old 11-04-2014, 09:02 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
dont use get/set metadata, they are very ineeficient if all you want to do is change a couple of fields. Use db.new_api.field_for('title', book_id) and db.new_api.field_for('authors') and to change,

db.new_api.set_field('title', {book_id:value})
db.new_api.set_field('authors', {book_id:value})

Then use 'title_sort' and 'author_sort' to work with those fields.

ANd to set the window title use

self.setWindowTitle('whatever')
kovidgoyal is offline   Reply With Quote
Advert
Old 11-05-2014, 06:56 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: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Thanks, I changed to the new_api method.
Seems that using that one authors_sort and title_sort are automatically updated?
Much better than get/set metadata.

But self.setWindowTitle('whatever') does not work.
It is actually the window of the progressbar that shows the libprs500 text, no matter if I use self.setWindowTitle('whatever') or progressbarname.setWindowTitle('whatever')...
WS64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Title and Author Sort jgt1942 Library Management 5 05-26-2014 03:59 AM
Caibre - Fails to sort by Author, Title, etc LesWilk Devices 1 03-17-2012 06:41 AM
Sort by author then title richardwarriner Library Management 3 11-16-2011 01:00 PM
Author then title sort Gary Young Calibre 4 08-30-2010 10:03 PM
Sort by author AND title bookends Calibre 2 05-09-2010 01:55 PM


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


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