![]() |
#1 |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
Driver plugin: get file path of ebook?
Is there a way for a device driver plugin to get the original file path of an ebook, or do I need to open metadata.db and query for the path from there? For example, if I have a book at C:\Users\jgoguen\ebooks\Author\awesomebook.epub and I upload it to my device, the only path I can find how to get with the API is the obfuscated path in a temporary folder. I'm working on a plugin that modifies ePub files in transit and I'd like to be able to save the modified files back to the calibre library and replace the original book.
|
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,789
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No there's no way to get the original file path in a device driver. Device drivers are not supposed to be modifying files in the library. I for one would be pretty annoyed if sending files to a device caused the originals to be changed. Why do you need this capability?
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,315
Karma: 7957679
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Also note that device drivers run on a different thread. Modifying the library in any way from a device driver could lead to very difficult to debug inconsistencies. In addition, the ebook could have been modified by a plugboard before being handed to the device driver. Those modifications must not be made permanent.
|
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,880
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
My 2 cents
Many people don't keep the original source file in the same place (if at all) after import into Calibre, thus making use of any 'logged' 'original path/filename' inconsistent on further usage at best |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
Quote:
It's more of something that I personally would like to have the option for. The driver plugin I'm working on modifies the contents of ePub files (adds extra span tags to allow annotation saving and last read position saving to work better) before sending them to the device and I'd prefer to not have to re-parse the files on the occasional times where I re-upload a book for some reason. If the intention is that a driver plugin should never actually do this I won't bother, I can accomplish the same thing by removing the calibre book and saving from the device into my library. Last edited by jgoguen; 01-14-2013 at 07:31 AM. Reason: Missed an important post |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get the file path of the ebook in the frontmost Ebook Viewer window | johnsidi | Development | 1 | 07-16-2012 10:37 AM |
User Defined device plugin - path | scubaman | Devices | 1 | 12-22-2011 11:44 AM |
[Device Interface Plugin] Update for Nook Color Driver | jmricker | Plugins | 0 | 10-22-2011 10:11 AM |
Driver Plugin not rekognized | silentguy | Plugins | 2 | 12-01-2010 12:14 PM |
Remove file path from PDF file | DuckDodgers | 1 | 08-13-2006 09:23 AM |