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 09-21-2015, 03:57 AM   #1
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
How to get a list of books corresponding to the selected tag in the GUI plugin?

Hello

The user selects the tag by the left mouse button. Calibre shows book list that correspond to the selected tag.

How to get a list of books corresponding to the selected tag in the GUI plugin code to write the metadata to a remote database?

Last edited by esvorontsov; 09-21-2015 at 03:59 AM.
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 04:15 AM   #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
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount()}
kovidgoyal is online now   Reply With Quote
Old 09-21-2015, 06:54 AM   #3
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
How to get metadata of each book using book_ids?
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 07:19 AM   #4
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
_____
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 08:30 AM   #5
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
Quote:
Originally Posted by kovidgoyal View Post
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount()}
in Python 2.7 need to use xrange, but it is not important
m.rowCount() requires two arguments - ???
what is the name of the model class?
what method of the model class will return the metadata for book_id?
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 09:11 AM   #6
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
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount(None)}
self.gui.current_db.new_api.get_metadata(book_id)
print (m.__class__)
http://manual.calibre-ebook.com/deve...rts-of-calibre
kovidgoyal is online now   Reply With Quote
Old 09-29-2015, 10:06 AM   #7
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
thank
esvorontsov is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Reading List kiwidude Plugins 1319 04-25-2024 09:27 AM
[GUI Plugin] Import List kiwidude Plugins 613 04-01-2024 08:36 AM
Getting IDs of books selected in the GUI wladdy Calibre 3 05-09-2015 06:23 AM
[GUI Plugin] Manage Sony x50 Reader Book List kpw Plugins 170 10-02-2014 08:23 PM


All times are GMT -4. The time now is 12:53 PM.


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