![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
|
Metadata knowing bookID (outside the ui)
I have found in good examples of getting a calibre.ebook.Metadata object given a bookId but so far I have only seen it in InterfaceAction plugins (they get everything they need to get to the gui.db in __init__).
I'm trying to run do the same thing (get Metadata knowing a bookid) but from a Source plugin running in cli mode (calibre-debug -r "mypluginname"). I saw that there is a show_metadata method in calibredb and that seemed promising because it's the same no-ui context but I got lost trying to find where the contextdb that command uses to access the database is created. Could anyone point me to an example that would show how to get to the book metadata knowing the bookid when the context is a "no ui" loaded context? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Metadata source plugins do not have access to the db. For example, they can be run in the fetch-ebook-metadata standalone cli tool. What is your plugin actually trying to do?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
|
Quote:
I know very well that having the best cover, the best description, the best tags, the most accurate information, a link to the author's page, etc.. wont make my books gain any value or make me want to read them more... yet I spend I stupidly long amount of time on exactly doing those things. I do it almost compulsively. Time to stop working on that project, and go read a book. Thanks for you help. |
|
![]() |
![]() |
![]() |
#4 |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,233
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
|
LOL! I am not the only one!
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 5
Karma: 80
Join Date: Apr 2011
Device: nook color
|
Man, I could really use this kind of a plugin.
I'm trying to organize my audiobook collection and I've been using Calibre to get all the meta data details of the books then using a python script to clean up all the audio-file tags using the Calibre gleaned meta data. I've added a few extra fields in Calibre (narrator, duration, number of files, uuid, audiobook reported date, etc) and the Import List plugin to create empty books for each audiobook directory and any meta data I can scrape from the audio file tags. My original plan was to use the Calibre Content server then do a search on the UUID I create for each audiobook, but I have no idea how to scrape dynamic content produced by the Content Server (that's some seriously scrape resistant javascript). For now, I'm exporting a CSV catalog file of the Calibre metadata then using that file to get the audiobook details during audio-file tagging. Having a RESTful interface to get the specific Calibre book content given the UUID would be a nice thing to have. Another nice plugin would be a way to programmatically add empty books into Calibre (for later Calibre clean up/look up). |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Both of those a possible using calibredb
And the calibre server has a JSON API that allows you to get pretty much any data nad perform pretty much any operation you like on a calibre server (this is the api that calibredb uses to conenct to calibre servers). |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 5
Karma: 80
Join Date: Apr 2011
Device: nook color
|
I was just looking at the database API and ... there are the things I need! I wish I would've read that before posting, he says sheepishly.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Knowing when you've done good | gmw | Writers' Corner | 29 | 05-30-2017 01:55 AM |
Getting BookId from viewer plugin | Terisa de morgan | Plugins | 7 | 10-26-2016 04:54 PM |
Ever kept reading despite knowing better? | Katsunami | General Discussions | 38 | 06-28-2016 11:34 PM |
Using the ISBN as "BookID" instead of UUID | ibu | Sigil | 19 | 08-20-2013 11:29 AM |
Do you start on a trilogy knowing the last book is not out! | thinkpad | General Discussions | 92 | 11-26-2010 03:12 AM |