![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2022
Device: Kobo Libra H2O
|
Searching for another book by its identifier
Hey all, couldn't find any other topic that answered my question, hopefully I didn't miss anything.
The plugin I'm writing is intended to be able to automatically copy metadata from the first book in a series over to later installments. So for example, I'd import a book with the identifier of "wxyz:1234-2" (this is a custom format that includes the series and volume number), and it would automatically search for the first entry in that series and copy its series name, authors, tags, etc. However, I can't figure out any way to actually find books in the database from their identifiers. The API does have a field that seems likely, but for some reason it's empty. My tags display with no issue, and I do indeed have books in my library that already have identifiers set. Code:
>>> db.all_field_names('tags') frozenset({'Manga', 'GOG', 'Novel', 'Aozora', 'Amazon'}) >>> db.all_field_names('identifiers') frozenset() >>> ![]() |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2022
Device: Kobo Libra H2O
|
Seems like I can get what I want by using
Code:
db.search('identifiers:wxyz:1234-1') |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
all_field_names is for many-to-one or many-to-many fields. identifiers is not one of them. identifiers are intended to be unique per book. Using search is fine for this use case.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2022
Device: Kobo Libra H2O
|
That makes sense! I figured since it didn't raise an error (as it would have if I'd used a field name that didn't exist at all) that there was some way to do it that I wasn't understanding. Thank you for the confirmation
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with removing identifier from book | Terisa de morgan | Library Management | 2 | 11-04-2019 09:49 AM |
Doubt about removing identifier in book | Terisa de morgan | Library Management | 6 | 04-08-2019 03:20 AM |
Aura HD Searching in a book | bookwurm70 | Kobo Reader | 2 | 07-08-2014 04:32 PM |
No identifier causes delay in View and Edit Book | MerlinMama | Calibre | 17 | 06-02-2014 07:03 PM |
Searching within a E-Book | benjaminvm | Sony Reader Dev Corner | 3 | 08-18-2008 11:44 AM |