View Single Post
Old 02-01-2017, 06:03 PM   #41
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by kido.resuri View Post
What if you mount /mnt/onboad/.mysd to /mnt/sd/virtual, then after nickel does the content update, you execute this sql query:

Code:
UPDATE content SET ContentID = REPLACE(ContentID,'/mnt/sd/virtual/','/mnt/onboard/.mysd/'), BookID = REPLACE(BookID,'/mnt/sd/virtual/','/mnt/onboard/.mysd/');
UPDATE Activity SET Id = REPLACE(Id,'/mnt/sd/virtual/','/mnt/onboard/.mysd/');
DELETE FROM Activity WHERE Id LIKE '%/mnt/sd/virtual/%';

I tried, but edited the database offline, then copied back over ftp, rebooted, and it works. So it should work on Kobo itself with a script.

EDIT: I tried the query on the Kobo itself, and it works. nickel needs a restart tho to see the changes. It would be good to detect when nickel finishes the content update from the virtual sd, so we could execute a script with the query and make a restart. Maybe it's not a real good idea, because every time it gets mounted, the old files are updated to, so it would be a better idea to move the content already read by nickel to another subdir. Makes it too complicated and vulnerable maybe.
You might be able to use a trigger to do the change as the book is added when the virtual SD card is inserted. But, you also need to prevent the book from being added each time the virtual SD card is inserted.
davidfor is offline   Reply With Quote