Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2022, 11:01 PM   #1
neuraltoxin
Member
neuraltoxin began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2022
Location: Vancouver, BC
Device: Kobo Clara HD
Lightbulb Programatically trigger library scan

Hi all,
I'm the author of https://kobli.me and I recently released a version that allows users to download an epub from Google Drive to the device over Wifi.

The download works great but the library refresh is somewhat flaky. Here's the code I have to do the library refresh. It works sometimes but not others:

Lib=/mnt/onboard/.add/koblime/library
SD=/mnt/sd/koblime

mountpoint -q "$SD"
if [ $? -ne 0 ]; then
mount --bind "$Lib" "$SD"
fi
echo sd add /dev/mmcblk1p1 >> /tmp/nickel-hardware-status


Perhaps I need a sleep after the mount. Thanks in advance for any help

PS: I am not actually using a bash script. My app is written in Go and cross-compiled to arm7 but it's essentially doing the above...
neuraltoxin is offline   Reply With Quote
Old 09-07-2022, 01:34 AM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,117
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
If the user has NickelMenu installed, you can trigger a book import using:
Code:
menu_item : <location> : Import books : nickel_misc : rescan_books_full
Replace <location> with main, library, etc. corresponding to where you want to see the menu item.
DNSB is offline   Reply With Quote
Advert
Old 09-07-2022, 03:38 AM   #3
neuraltoxin
Member
neuraltoxin began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2022
Location: Vancouver, BC
Device: Kobo Clara HD
Quote:
Originally Posted by DNSB View Post
If the user has NickelMenu installed, you can trigger a book import using:
Code:
menu_item : <location> : Import books : nickel_misc : rescan_books_full
Replace <location> with main, library, etc. corresponding to where you want to see the menu item.

I've been looking at the NM code and it looks like I can make calls into libnickel.so to trigger a sync. Thanks! I'm on the right track.

PS: What are the odds - another Vancouverite...
neuraltoxin is offline   Reply With Quote
Old 09-07-2022, 07:42 AM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,490
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by neuraltoxin View Post


PS: What are the odds - another Vancouverite...
Just hoping your brains don't rot from all that rain... (Joking; from Toronto)

Sent from my Pixel 4a using Tapatalk
PeterT is offline   Reply With Quote
Old 09-07-2022, 06:21 PM   #5
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,804
Karma: 7025947
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
I've responded to your email, basically:

- You need to call libnickel from within; a separate process won't work.
- Alternatively, you can use Sherman's NickelDBus along with godbus or simply calling qndb with exec.Cmd;
- or you can write a custom one with NickelHook which listens over DBus, a Unix socket or SysV IPC.
geek1011 is offline   Reply With Quote
Advert
Reply

Tags
koblime, refresh


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scan digital library and extract all Table of Contents from all books? bounce General Discussions 8 05-20-2019 05:07 PM
Glo How to trigger library update after side-load? Kobold001 Kobo Developer's Corner 1 03-21-2016 06:29 PM
Force scan of library folder for unadded books Barty Library Management 3 08-01-2015 04:18 PM
Do the new readers have the library scan issue? HarryT Sony Reader 18 09-17-2010 03:21 PM
BUG: No ability to re-scan or delete entries in the library D4N14L enTourage Archive 2 04-08-2010 09:03 AM


All times are GMT -4. The time now is 12:05 PM.


MobileRead.com is a privately owned, operated and funded community.