|
|
Thread Tools | Search this Thread |
09-21-2015, 03:57 AM | #1 |
Member
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. |
09-21-2015, 04:15 AM | #2 |
creator of calibre
Posts: 43,870
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()} |
Advert | |
|
09-21-2015, 06:54 AM | #3 |
Member
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
|
How to get metadata of each book using book_ids?
|
09-21-2015, 07:19 AM | #4 |
Member
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
|
_____
|
09-21-2015, 08:30 AM | #5 | |
Member
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
|
Quote:
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? |
|
Advert | |
|
09-21-2015, 09:11 AM | #6 |
creator of calibre
Posts: 43,870
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__) |
09-29-2015, 10:06 AM | #7 |
Member
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
|
thank
|
|
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 |