Quote:
Originally Posted by fastrobot
Thank you so much for warning me -- I know I would have managed to waste hours on this otherwise. I will make sure to rename the pdf file to something else before trying again.... There's nothing worse than to a make a mistake once and have it stuck on a bug forever and not knowing about it.
|
I'm not sure that tshering is right, or at least I don't know what the mechanism is. As far as I can see, if you put a book on the device when it is connected to the PC, it will be processed on disconnect. It will be processed each time processing is done until the book is added to the database or it is removed. And until it is successfully processed, it blocks other books from being processed.
There might be a timestamp involved. That would explain why a touch had the books processed. If so, I don't know where it is. There is a "LastSyncTime" in the config file, but I have always assumed that is for the server sync. "__SyncTime" in the content table is the time the book was processed, so it might just be the maximum value of that. Or it could be in memory or on the root partition somewhere. In any case, it shouldn't be hard to come up with a test case for this.
One thing that hasn't been mentioned is that downloading a book with the browser will get it added to the library. From memory, the browser is running as a separate process, so there has to be some communications between it and nickel. If you can work out what that is, it might be usable.
Looking at the strings file I produced from libnickel, I can see:
Code:
void SyncFileSystemCommand::findFilesToParse(const QString&, QStringList&)
void SyncFileSystemCommand::pruneSideLoadedFiles(QStringList&, const QList<QString>&, QVector<Volume>&)
void SyncFileSystemCommand::parseFB2(const QString&) const
void SyncFileSystemCommand::parseKepub(const QString&) const
void SyncFileSystemCommand::parseTextDocument(const QString&)
virtual void SyncFileSystemCommand::execute()
I think the second one is used to check if the known sideloaded books are still there or have changed. But, the first one looks interesting. And the message, "BUG! Someone ran findFilesToParse with a wrong folder path:" suggests it is the right method.
Of course, you could always add the book directly to the database. You have to parse the metadata and ToC and build the rows, but it is possible. I wrote some code a long time ago to do it in the calibre driver, but was never happy with it, so decided to leave it to the device. I think I understand the database better now, and do have code to update the ToC for some books.
And a last thought, as you have devices with external SD cards, you could put the books there and unmount/mount it somehow. Or fake it using a directory on the internal card. Someone did something like this for a google drive sync. I don't know if it still works or not.