View Single Post
Old 02-01-2017, 04:24 PM   #36
kido.resuri
Groupie
kido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura about
 
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
Ok, played with it a bit.

Code:
mkdir -p /mnt/onboard/.mysd
mkdir -p /mnt/onboard/.mybooks
Then I copied 3 epubs over ftp to /mnt/onboard/.mysd

Then i did over telnet:
Code:
mount --bind /mnt/onboard/.mysd/ /mnt/sd/virtual
echo sd add /dev/mmcblk1p1 >> /tmp/nickel-hardware-status
(wait untill nickel finished reading content)
umount /mnt/sd/virtual/
mv /mnt/onboard/.mysd/* /mnt/onboard/.mybooks/
echo "UPDATE Activity SET Id = REPLACE(Id,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/');" | sqlite3 "/mnt/onboard/.kobo/KoboReader.sqlite"
echo "UPDATE content SET ContentID = REPLACE(ContentID,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/'), BookID = REPLACE(BookID,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/') WHERE (ContentID LIKE '%/mnt/sd/virtual/%') OR (BookID LIKE '%/mnt/sd/virtual/%');" | sqlite3 "/mnt/onboard/.kobo/KoboReader.sqlite"
reboot
After this, I had the 3 books in the library, nickel worked on them a bit to create the cover images, after that they opened perfectly. I think this could be automated. The slowest command was the sql query for content table, it took a few seconds to finish, but everything else was quite fast. The UPDATE Activity sql query could be changed to DELETE, as no new book notification is shown after the reboot, so it makes no sense really to UPDATE it.

Last edited by kido.resuri; 02-02-2017 at 03:51 PM. Reason: modified sql query to work faster
kido.resuri is offline   Reply With Quote